Find indices of one array in another array.
3 次查看(过去 30 天)
显示 更早的评论
I have two different sized two column arrays, like the example below:
A = [1 1; 1 2; 2 2; 2 3; 3 3; 3 4; 4 3; 4 4];
B = [1 1; 2 2; 3 3; 4 4];
Now I want to find the indices of the rows in A that are equal to B. So the answer should be:
idx_rows = [1 3 5 8]
How can I do this?
Thanks!
0 个评论
采纳的回答
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!