substitute for do while loop
8 views (last 30 days)
Show older comments
I need to implement and exit controlled loop in matlab.Is there a efficient replacement to the 'do...while' that can be in matlab?Or do we need to use some other logic?
1 Comment
Accepted Answer
Jan
on 23 Jun 2015
doLoop = true;
while doLoop
disp('in loop');
if rand < 0.01 % <- Your control to break the loop
doLoop = false;
end
end
More Answers (0)
See Also
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!