Clear Filters
Clear Filters

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

1 view (last 30 days)
if(i~=4)
if (dx/yg(i))<tand(sia)
goto X
else
P(i-1)=0
end
else
X
end

Answers (1)

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

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!