How to find the index of a column data whose values are equal to another column data?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
For example:
A = [31; 2; 57; 36; 87; 36];
B = [2; 36];
My goal is to find the inex of all the column A that are equal to any elements of B. In this case, the answer would be:
Ind = [0; 1; 0; 1; 0; 1];
For both A and B, I have extramely large number of rows, so it won't be efficient to write a loop. What is the most efficient way to performace this task?
Many thanks.
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!