Search for values in a matrix
6 ビュー (過去 30 日間)
古いコメントを表示
Scott Dean Seedell
2022 年 9 月 9 日
編集済み: Walter Roberson
2022 年 9 月 13 日
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 件のコメント
採用された回答
Walter Roberson
2022 年 9 月 9 日
編集済み: Walter Roberson
2022 年 9 月 13 日
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!