Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

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

Scilab help >> Scilab > Control flow > case


keyword used in statement "select"


Keyword used in statement select ... case ... end

Keyword case points out one variant of a variable value (it is the variable value which is selected from a range of values).

Use it in the following way:

select expr0
    case expr1 then
        instructions 1
    case expr2 then
        instructions 2
    case exprn then
        instructions n
    [else instructions]


select OS
case "Windows" then
  disp("Scilab on Windows")
case "Linux" then
  disp("Scilab on Linux")
case "Darwin" then
  disp("Scilab on MacOs")
  error("Scilab on Unknown platform")

See Also

  • select — select keyword
  • while — while keyword
  • end — end keyword
  • for — language keyword for loops
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:36:20 CEST 2013