substitute for do while loop
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Terry McGinnis
le 23 Juin 2015
Commenté : Terry McGinnis
le 23 Juin 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 commentaire
Réponse acceptée
Jan
le 23 Juin 2015
doLoop = true;
while doLoop
disp('in loop');
if rand < 0.01 % <- Your control to break the loop
doLoop = false;
end
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!