How do i break a loop at set values to NaN

I need to break a loop when i reach values if alpha<-pi or apha>pi and set values for alpha and x(direction) to NaN, this is not working, please adivse
if alpha(i)<(-pi)||alpha(i)>(pi)
break
x(i+1:end)=NaN;
alpha(i+1:end)=NaN;
end

 Respuesta aceptada

per isakson
per isakson el 6 de Abr. de 2019
Try
if alpha(i)<(-pi)||alpha(i)>(pi)
x(i+1:end)=NaN;
alpha(i+1:end)=NaN;
break
end

Más respuestas (0)

Categorías

Productos

Versión

R2018b

Preguntada:

el 5 de Abr. de 2019

Editada:

el 6 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by