I'd like to use an example to show what I want.
A = [5 1 2 4 3]; % of distinct values
B = [3 3 1 5 2];
Can I find a library function implemented in MATLAB such that:
C = [5 5 2 3 1] = someFun(A, B)
i.e. C(i) = find(A == B(i))
Note that I am asking for a library function, as in that case it is highly optimized. If you are sure there doesn't exist such a function, that is also an answer.