I am trying to find indices of the elements in one cell array in another cell array in MATLAB. For example:
a = {'Hello', 'Good', 'Sun', 'Moon'};
b = {'Well', 'I', 'You', 'Hello', 'Alone', 'Party', 'Long', 'Moon'};
I expect to get the following result which shows the index of elements of $a$ in array $b$:
index=[4, NaN, NaN, 8];
I know it is possible to implement it using loops, but I think there is simple way to do that which I don't know.
Thanks.