From the FIND documentation
To find a noninteger value, use a tolerance value based on your data. Otherwise, the result is sometimes an empty matrix due to floating-point roundoff error.
y = 1×11
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000
k = 1x0 empty double row vector
k = find(abs(y-0.3) < 0.001)
k = 4
0 Comments
Sign in to comment.