MATLAB Answers

show all rows where value in column 13 is equal to a specific number

40 ビュー (過去 30 日間)
Locks
Locks 2013 年 5 月 4 日
Hi,
I know that I can display all elements of the first column of a matrix that are larger than 1500 by using this command:
find(data18(:,1)>1500);
However, I would like to find all the rows where the value in column 13 is equal to one and I tried this:
find(data18(:,13)==1);
From what I can see, this is not working. What is wrong with that code?
In addition, I would like to see not only the value in those columns where the value is equal to 1, but also from all other elements of that specific row

採用された回答

Image Analyst
Image Analyst 2013 年 5 月 4 日
編集済み: Image Analyst 2013 年 5 月 4 日
Probably because data18 is floating point, not integer. And in the second case you're checking for EQUALITY, while in the first case you were checking for "greater than." Please read and understand the FAQ on this topic: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F
  3 件のコメント
Locks
Locks 2013 年 5 月 4 日
perfect, thanks!

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by