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 > Scilab keywords > elseif


keyword in if-then-else


If there is more than one condition then keyword elseif is useful. If there is more than one elseif then the first true condition is selected (even other also are true).


if a==1 then
    disp("a equals 1")
elseif a==2 then
    disp("a equals 2")
elseif a==1 & a>0 then
    disp("this condition is true, but never will be selected, because it is the second true condition.")
    disp("Case not handled.")

See Also

  • if — keyword for conditional execution
  • select — select keyword
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