Search for values in a matrix

2 次查看(过去 30 天)
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
mask = any(YourMatrix(:, 1:2)==SearchValue,2);
subset = YourMatrix(mask, :) ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by