Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个元素数组,我想在另一个矩阵中查看它们的索引
例如,对于
A = [1 2 3] B = [1 2 3 4 5 3 4 5 1 2 3]
然后结果数组
C = [1 2 3 6 9 10 11]
给出 1 2 3 的索引
是否有任何功能或简短的处理方法?
我想你想要:
find(ismember(B, A)) ans = 1 2 3 6 9 10 11