why my matlab code calculates the inequality wrongly?

3 vues (au cours des 30 derniers jours)
Pooneh Shah Malekpoor
Pooneh Shah Malekpoor le 23 Oct 2022
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!!!!

Réponse acceptée

James Tursa
James Tursa le 23 Oct 2022
Modifié(e) : James Tursa le 23 Oct 2022
Negative numbers are not greater than positive numbers. This is the correct result. What is strange to you about this?
  1 commentaire
Pooneh Shah Malekpoor
Pooneh Shah Malekpoor le 23 Oct 2022
Oo, I had to add an abs in my formula. Now, resolved

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by