Effacer les filtres
Effacer les filtres

exiting if condition and for loop?

118 vues (au cours des 30 derniers jours)
Arunachalam  D
Arunachalam D le 18 Juil 2015
for i=1:100
if condition
operations;
else
continue
end
end
here continue will exit out of the if loop but thing is that if else statement executed it should come out of for loop. how can i do that

Réponse acceptée

per isakson
per isakson le 18 Juil 2015
Try
for i=1:100
if condition
operations;
else
break
end
end

Plus de réponses (0)

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!

Translated by