Consider the following arrays:
A = [1 3 4 5 6 7 1 3 7];
B = [1 4 7];
I want to find all elements of B in array A. So, my final output array will look something like:
C = [1 7 3 6 9];
First element of B is at locations 1 and 7 in array A, so C has 1 and 7 as first two elements. Element 4 of B is at location 3, so array C has 3 as its third element and so on.