Search for values in a matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Scott Dean Seedell
el 9 de Sept. de 2022
Editada: Walter Roberson
el 13 de Sept. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 9 de Sept. de 2022
Editada: Walter Roberson
el 13 de Sept. de 2022
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Triangulation Representation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!