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 > select

select

select キーワード

説明

select expr,
  case expr1 then instructions1,
  case expr2 then instructions2,
  ...
  case exprn then instructionsn,
  [else instructions],
end

注意:

  • 唯一の規則は,各 "then" キーワードを対応する "case" キーワードと同じ行に 置く必要があることです.

  • キーワード "then" の代わりにキャレッジリターンまたはカンマを使用することができます. instructions1expr1=expr の場合に実行される, といったようになります.

警告: 条件文(if while for または select/case)の本体の定義に使用できる文字数は 16k に制限されています.

while %t do
  n=round(10*rand(1,1))
  select n
  case 0 then 
    disp(0)
  case 1 then
    disp(1)
  else
    break
  end
end

参照

  • if — 条件付き実行
  • while — while キーワード
  • for — ループ用の言語キーワード
Report an issue
<< return Control flow then >>

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