Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> 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

注意:

  • 唯一の制約は, then または do" キーワードを while キーワードと同じ行に置く必要がある ことです.

  • キーワード then または do は キャレッジリターンまたはカンマで置換することができます. Matlabとの互換性のため,推奨されませんが, 式の終わりと命令の始まりの間に空白を置く方法で代替することも可能です.

  • オプションの ,else instructions 構造により, 式の評価が偽となった場合に実行される命令を指定することが可能です.

警告: 条件付き命令(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

参照

  • for — ループ用の言語キーワード
  • select — select キーワード
  • break — ループ中断を表すキーワード
  • return — リターンまたは復旧し,ローカルな変数をコピー
  • pause — 中断モード, キーボード入力を待つ
Report an issue
<< then Control flow Debugging >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:40:15 CEST 2012