I’m having trouble to modify my code in an efficient way. I have a table of indices, say
table_of_indices=[1,2; 2,3; 3,1; 1,3; 11,8];
and take a specific element in that table
E=[1,3];
Is there a smart way to find the position of E in my table?
For now, I’m using
pos=find(ismember(table_of_indices, E, 'rows'));
but this is obviously super slow for a large table. I’ve found this question Faster alternatives to ismember in Matlab when index positions are needed? but I couldn’t manage to translate that solution to my problem. Thanks for the help!
New contributor
Spida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.