<< then Control flow Configuration >>

Scilabヘルプ >> Scilab > Control flow > while

while

while キーワード

説明

while 構文. "end"で終わる必要があります.

while expr ,instructions,...[,else instructions], end

while expr do instructions,...[,else instructions], end

while expr then instructions,...[,else instructions], end

注意:

Scilabプログラミング言語のコード規約に基づき, 以下が推奨されます:

例えば以下のようにします:

i = 0
while i<5
    disp("i");
    i = i + 1;
end

以下は推奨されません.

i = 0; while i<5 disp("i"); i = i + 1; end

警告: 条件付き命令(if while for または select/case)の本文を定義するために使用可能な 文字数は 16 k以下とする必要があります.

e=1; a=1; k=1;
while norm(a-(a+e),1) > %eps,
    e=e/2;
    k=k+1;
end
e,k

参照


Report an issue
<< then Control flow Configuration >>