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

1 次查看(过去 30 天)
if(i~=4)
if (dx/yg(i))<tand(sia)
goto X
else
P(i-1)=0
end
else
X
end

回答(1 个)

dpb
dpb 2020-12-22
编辑:dpb 2020-12-22
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 个评论
dpb
dpb 2020-12-22
BTW, if had rest of loop over i, it's quite possible/probable(?) could eliminate it and vectorize the expression.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by