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.

 採用された回答

Walter Roberson
Walter Roberson 2022 年 9 月 9 日
編集済み: Walter Roberson 2022 年 9 月 13 日

0 投票

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by