why my matlab code calculates the inequality wrongly?
1 次查看(过去 30 天)
显示 更早的评论
Hello
I am defining inequility for a condition; however, Matlab cannot compare two sides correctly as is attached here. How should I solve this issue?

even matlab says:
-5.4485 >= 1e-6
ans =
logical
0
It is strange!!!!
0 个评论
采纳的回答
James Tursa
2022-10-23
编辑:James Tursa
2022-10-23
Negative numbers are not greater than positive numbers. This is the correct result. What is strange to you about this?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!