Search for values in a matrix
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Scott Dean Seedell
le 9 Sep 2022
Modifié(e) : Walter Roberson
le 13 Sep 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 commentaires
Réponse acceptée
Walter Roberson
le 9 Sep 2022
Modifié(e) : Walter Roberson
le 13 Sep 2022
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Triangulation Representation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!