Search for values in a matrix
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Scott Dean Seedell
il 9 Set 2022
Modificato: Walter Roberson
il 13 Set 2022
I'd like to search the first two columns of a matrix for a specific value and then return the whole row for any that match. Thanks in advance.
0 Commenti
Risposta accettata
Walter Roberson
il 9 Set 2022
Modificato: Walter Roberson
il 13 Set 2022
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Triangulation Representation 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!