The find function does not find the attribute element and outputs an empty row vector. What's the reason?
Show older comments
Here's my code.
for example,
V_bg=0.6:1/100:1.2;
output=find(V_bg==0.9);
i want to find value 0.9 but the ans is just 1x0 empty double row vector ?
i don't why
1 Comment
Stephen23
on 28 May 2021
"What's the reason?"
Because you are testing for exact equivalence of values which are not exactly the same.
Read more about binary floating point numbers:
This is worth reading as well:
Accepted Answer
More Answers (0)
Categories
Find more on Big Data Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!