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!