What happen to this loop?
Show older comments
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
Accepted Answer
More Answers (1)
Image Analyst
on 14 Jun 2022
0 votes
See the FAQ
If you want, you can use >= instead of == or use ismembertol
1 Comment
Allen Wei
on 15 Jun 2022
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!