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.

 Réponse acceptée

Walter Roberson
Walter Roberson le 9 Sep 2022
Modifié(e) : Walter Roberson le 13 Sep 2022

0 votes

mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by