substitute for do while loop
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Terry McGinnis
il 23 Giu 2015
Commentato: Terry McGinnis
il 23 Giu 2015
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 Commento
Risposta accettata
Jan
il 23 Giu 2015
doLoop = true;
while doLoop
disp('in loop');
if rand < 0.01 % <- Your control to break the loop
doLoop = false;
end
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!