issue in find variable
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论

2 个评论
Muhammad Usman Gul
2020-7-22
"Please explain to me why it gives me an empty matrix?"
Read about the behaviors of binary floating point numbers:
This is worth reading as well:
回答(1 个)
Fangjun Jiang
2020-7-22
编辑:Fangjun Jiang
2020-7-22
floating point data precision issue. Below is an example, a and b are not equal even though all the visible digits are the same.
>> format long
>> a=1-1/3
a =
0.666666666666667
>> b=2/3
b =
0.666666666666667
>> a==b
ans =
logical
0
>> abs(a-b)<=eps
ans =
logical
1
3 个评论
Muhammad Usman Gul
2020-7-22
Fangjun Jiang
2020-7-22
find(abs(YouData-0.06)<=eps)
Muhammad Usman Gul
2020-7-22
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!