find behavior is weird

8 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by