The find function does not find the attribute element and outputs an empty row vector. What's the reason?

 Accepted Answer

To find a noninteger value using the find function, it is recommended to use a tolerance value based on your data. Otherwise, the result is sometimes an empty matrix due to floating-point roundoff error. You can have look at the documentation for further details.
V_bg=0.6:1/100:1.2;
% change the tolerance level according to your liking
output=find(abs(V_bg-0.9)<0.001);

More Answers (0)

Products

Release

R2020b

Tags

Community Treasure Hunt

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

Start Hunting!