I have two matrices and I want the corresponding all indices, not just the first one. Here is the example
A = ... [2 2 4 4 5 4 1 1 4 4 3 2 1 2 4 2 4 4 1 4 1 1 1 1 5 3 3 4 3 5 4 5 4]
and
B = [ 1 4 1 4 3 5 4 5 4]
I used intersect as follows and got the following output:
[AB,ia,ib] = intersect(A,B,'rows')AB = 1 4 1 4 3 5 4 5 4ia = 7 10 2ib = 1 2 3
is it possible to get ia = [7 10 2, 11]?
Best Answer