我在 Matlab 中有三个嵌套循环,在每个循环中,我都有一个检查标志的“if”。如果没问题,算法就会继续,否则,我希望程序应该被终止。这是我的代码,我认为有问题!
[A] = finction (...,...,...)
for i = 1:100
for j = 1:100
for k = 1:30
some operation which its results is a flag
if flag==1 % its initial value is 0
break
end;
end;
end;
end;
为了中断其余的计算,应该把中断放在哪里?