why '==' is not working properly, or what do I do wrong?

I just want to know why this happens...
Untitled.png

댓글 수: 1

More than likely this is a limitation of the binary. If you expand the number of sigfigs on a(5) and b(100) you will likely find that some small decimal place is slightly different.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jos (10584)
Jos (10584) 2018년 11월 21일
There is a small difference, as shown by subtraction:
b(100)-a(5)
To tolerate such a small difference between x and y, try this
abs(x-y) < .0001

카테고리

도움말 센터File Exchange에서 Elementary Math에 대해 자세히 알아보기

질문:

2018년 11월 21일

답변:

2018년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by