i want to use goto to jump from third line to eighth line.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
if(i~=4)
if (dx/yg(i))<tand(sia)
goto X
else
P(i-1)=0
end
else
X
end
0 comentarios
Respuestas (1)
dpb
el 22 de Dic. de 2020
Editada: dpb
el 22 de Dic. de 2020
if (i==4)|((dx/yg(i))<tand(sia))
X
else
P(i-1)=0
end
or
if (i~=4)&((dx/yg(i))>=tand(sia))
P(i-1)=0
else
X
end
1 comentario
dpb
el 22 de Dic. de 2020
BTW, if had rest of loop over i, it's quite possible/probable(?) could eliminate it and vectorize the expression.
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!