The for loop gives an odd number instead of 0?
Ältere Kommentare anzeigen
Hello, I have a easy question but it is making me crazy.I have a for loop as follow:
zr4=1.1;zr2=-0.1;
KK=0.1;
for LL=1:DD
zr2=zr2+KK;
zr4=zr4-KK;
.......
end
When I see the result, Zr4 is changing from 1 to 1.3878e-16. I am so confused. after 0.1 instead of giving 0, it gives 1.3878e-16. I appreciate if you help me. Thanks
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!