<< case Control flow do >>

Scilab Help >> Scilab > Control flow > continue

continue

ループの次の反復に制御を移すキーワード

説明

for または while ループの中で, コマンド continue はループの次の反復に制御を移します. この際,この命令とループのend命令の間に 残る命令を全てスキップします.

for k=1:10
    K=k;
    if k>2 & k<=8 then
       continue
       disp('hello')
    end
    k
end

for j=1:2
  x=[];
  for k=1:10
    if k>j+1 & k<=8 then
      continue
    end
    x=[x,k];
  end
  x
end

参照

履歴

VersionDescription
6.0.0 continue is now protected: Assignments like continue=1 is now impossible.

Report an issue
<< case Control flow do >>