Get row number with certain data in it

3 ビュー (過去 30 日間)
Mert Gurer
Mert Gurer 2021 年 9 月 22 日
コメント済み: Mert Gurer 2021 年 9 月 22 日
Hello together,
i want to find a solution for my problem:
I have a 230x2 Matrix, which contains different numbers. I want the programm to tell me, which row contains numbers higher than 400.
How can i do that?
I tried the "find"-function but it didnt bring me to a useful result.
Thank you.
MG.

回答 (1 件)

Stephen
Stephen 2021 年 9 月 22 日
編集済み: Stephen 2021 年 9 月 22 日
"I tried the "find"-function but it didnt bring me to a useful result."
It works for me:
% Fake data:
M = randi(9,7,2);
M(5,1) = 789
M = 7×2
3 8 2 3 9 7 6 5 789 6 5 2 7 9
% Find row:
[R,~] = find(M>400)
R = 5
  1 件のコメント
Mert Gurer
Mert Gurer 2021 年 9 月 22 日
Thank you Stephen

サインインしてコメントする。

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by