I have two cell arrays, one is the array I want to find indices of multiple strings. Say q = { 'A', 'B' } and p = { 'H', 'F', …, 'Z' }. Is there a function that finds the strings and returns their indices like ans = [ 12, 3 ] ? Or the only way is to use a for loop and find(strcmp(…)) which doesn't seem very efficient?
MATLAB: Is there a dsearchn equivalent for strings
dsearchnfindindexsearchstring
Best Answer