Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
MANOJ KUMAR
MANOJ KUMAR am 22 Dez. 2020
Bearbeitet: dpb am 22 Dez. 2020
if(i~=4)
if (dx/yg(i))<tand(sia)
goto X
else
P(i-1)=0
end
else
X
end

Antworten (1)

dpb
dpb am 22 Dez. 2020
Bearbeitet: dpb am 22 Dez. 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 Kommentar
dpb
dpb am 22 Dez. 2020
BTW, if had rest of loop over i, it's quite possible/probable(?) could eliminate it and vectorize the expression.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by