What happen to this loop?
Ältere Kommentare anzeigen
a=0
t=1
while t==1
a=a+0.01
if a == 0.5
t=0
end
end
%why it only break loop when a=a+0.1
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 14 Jun. 2022
0 Stimmen
See the FAQ
If you want, you can use >= instead of == or use ismembertol
1 Kommentar
Allen Wei
am 15 Jun. 2022
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!