find behavior is weird

8 visualizaciones (últimos 30 días)
ahmed shaaban
ahmed shaaban el 24 de Feb. de 2015
Comentada: ahmed shaaban el 24 de Feb. de 2015
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

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 24 de Feb. de 2015
  1 comentario
ahmed shaaban
ahmed shaaban el 24 de Feb. de 2015
thanks a lot it works, I modified it to be
find (abs(gLat-4.2) < 0.00001)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by