find behavior is weird

14 ビュー (過去 30 日間)
ahmed shaaban
ahmed shaaban 2015 年 2 月 24 日
コメント済み: ahmed shaaban 2015 年 2 月 24 日
Hello all I am trying to use find to find some value, however, it sometimes works, other not.
gLat = -40:0.1:40;
find(gLat == 4.2)
I found
ans =
Empty matrix: 1-by-0
Any explanation for this. Thanks in advance

採用された回答

Sean de Wolski
Sean de Wolski 2015 年 2 月 24 日
  1 件のコメント
ahmed shaaban
ahmed shaaban 2015 年 2 月 24 日
thanks a lot it works, I modified it to be
find (abs(gLat-4.2) < 0.00001)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by