MATLAB: Find behavior is weird

floating point equality comparisonprecision

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

Best Answer