Find same elements between two sequences

82 views Asked by At
a=[2 5 4 6 6 7 9 8 4 5 61 2 56 41]
b=[1 9 7 3 2 4 5 1 6 4 78 1 12 56 14 27 46 1 3 2 4]

how to find same elements in between two sequences in matlab. in above 2,4,5,6,7,9,56 are same elements.

1

There are 1 answers

0
jkazan On

c = intersect(a,b), or [c,ia,ib] = intersect(a,b) if you want indices as well.