Antworten (3)

KSSV
KSSV am 12 Apr. 2021

0 Stimmen

Note that you are comparing two floating point numbers and such numbers cannot be comapred using ==. Follow
tol = 10^-5 ;
idx = abs(val1-val2)<tol
Steven Lord
Steven Lord am 12 Apr. 2021

0 Stimmen

Two numbers that are displayed the same may not represent the same stored value. See this Answers post for more information about floating point numbers.

Kategorien

Produkte

Gefragt:

am 12 Apr. 2021

Kommentiert:

am 12 Apr. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by