I am trying to find the indices of elements in a vector that correspond to another vector, preferably without using loops. For example, my input might be:
DJ
Perhaps you could try intersect? It is suppose to be a lot faster:
[Intersect,indDJiSet,indJiSet] = intersect(DJiSet,JiSet)
The ordering does not matter, as long as the element exist in both list, the ind elements gives the index.