Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to find all the numbers greater than in a certain column then all the columns

1 回表示 (過去 30 日間)
Kalpha.mc
Kalpha.mc 2020 年 10 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I need some help to find out how to use find to determine all the numbers greater than x in a column.
Example
y =[1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16]
find all the numbers equal to or above 7 in column 2
answer should be 7 ,8
I had this T = find( y >=x) but that gives you the whole table.
  1 件のコメント
Kalpha.mc
Kalpha.mc 2020 年 10 月 4 日
Correct answer is z = find(y(:,2) >= x)

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 10 月 4 日
col = 2; %must be a scalar
T = y(find(y(:,col) >= x, col)
  1 件のコメント
Kalpha.mc
Kalpha.mc 2020 年 10 月 4 日
This one finds the rows not the the column. Unless im doing it wrong?

この質問は閉じられています。

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by