Thanks for the information. I thought it would consider the floating point error the same way on both sides of the equation so I thought it was a bug as for some cases worked and some did not.
If I am looking for values with decimals on tables, how do I bypass this error? Is there a smart way or I need to check if the value is within value+- 10*eps for example?
The usual approach is to include a tolerance, something like this (using the requested criterion of 10*eps) —
TF1 = (28.15e-3 - 28.15/1000) == 0
TF1 = logical
0
TF2 = (28.15e-3 - 28.15/1000) <= 10*eps
TF2 = logical
1
So instead of testing for equality, do essentially the same thing with a subtraction, test it against the criterion, and return a logical value result.
I think the abs() is needed because one quantized expression could be above or below the other quantized expression, and I don't think you'd know which it will be in general.
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Translated by
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.