2
我有三個嵌套循環在Matlab和每個循環中,我有一個「如果」,檢查一個標誌。如果沒問題,算法會繼續,否則,我希望程序應該終止。這是我的代碼,我認爲是錯的!打破嵌套循環
[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;
在哪裏應該把這個突破,以便打破其餘的計算?