Search for values in a matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Scott Dean Seedell
am 9 Sep. 2022
Bearbeitet: Walter Roberson
am 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 9 Sep. 2022
Bearbeitet: Walter Roberson
am 13 Sep. 2022
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Triangulation Representation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!