Hi,
Now I have a problem to find a easy and efficient way to find index of longer vector in another short vector.
Say, we have A = [1 3 2]; B = [1 2 1 3 2] ; I want C = BindexInA = [1 3 1 2 3] ;
- intersect ( ) omits repeated values;
- C = arrayfun(@(x)find(A==x,1),B) takes much time;
Is there any easy but efficient way to do this? Thanks in advance.
Best Answer