【发布时间】:2016-07-12 06:52:50
【问题描述】:
我在 MATLAB 中编写程序时遇到问题。我需要一个 goto 语句来解决我的问题。代码如下:
for i=1:n
1: newT=T(i)+unifrnd(-r,r);
newT=P(i)+unifrnd(-r,r);
if newT<Tmax && newT>Tmin && newP<Pmax && newP>Pmax
bestT=newT bestP=newP
else
go to 1
end
end
该 goto 语句有其他替代方法吗?
【问题讨论】:
标签: matlab