i want to use goto to jump from third line to eighth line.

1 vue (au cours des 30 derniers jours)
MANOJ KUMAR
MANOJ KUMAR le 22 Déc 2020
Modifié(e) : dpb le 22 Déc 2020
if(i~=4)
if (dx/yg(i))<tand(sia)
goto X
else
P(i-1)=0
end
else
X
end

Réponses (1)

dpb
dpb le 22 Déc 2020
Modifié(e) : dpb le 22 Déc 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 commentaire
dpb
dpb le 22 Déc 2020
BTW, if had rest of loop over i, it's quite possible/probable(?) could eliminate it and vectorize the expression.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by