Borrar filtros
Borrar filtros

exiting if condition and for loop?

109 visualizaciones (últimos 30 días)
Arunachalam  D
Arunachalam D el 18 de Jul. de 2015
Editada: Stefanie Schwarz el 4 de En. de 2022
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

Respuesta aceptada

per isakson
per isakson el 18 de Jul. de 2015
Try
for i=1:100
if condition
operations;
else
break
end
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by