I am using MATLAB R2016a version.Here is an example which explains my question.
a=[1,2,3,3,4,5,5,7,8,2] ; b=[1,2,3,3,2,4,5,5] ; [x,y]=ismember(b,a);
The output y is :
y=[1,2,3,3,2,4,5,5]
Whereas,I want the output to be:
y=[1,2,3,4,10,5,6,7]
I want the elements of b to be expressed in terms of indices of a,including the repeating elements. In ismember the indices of the repeated elements are repeated.
Any suggestions?
Best Answer