数字1〜22を入力します。 (数字が22のため)for-loop時間制限を設定しforループを中断する方法は?
(例)iをタイプするとfigure(1)が表示されます。 )
今私も、私はそれらのすべてを入力し、彼らは22
ともかけて、私は道の終わりを知りたいことができないので、22
にこのループの回数の上限を設定したいですこのループでは、すべての数値(22未満)を入力する必要はありません。
私は謝罪したコードを表示します、私に助言を与えてください。
for TNP=1:23
**% for-loop's end condition -->1. when i type all 22 number.
->2. when i type 23 to end the for-loop without typing more number.**
FN = input('Which figure do you want: ') **% here i would type the number of figure.**
if FN==1
F1=meshc(z(:,111:268))
grid on
hold on
elseif FN==2
F2=meshc(z(:,269:419))
grid on
hold on
elseif FN==3
F3=meshc(z(:,431:586))
grid on
hold on
.
.
.
else FN=23
close;
end
end
**% but even i add the 'break' for-loop doesn't end. what is the reason??**