otherwise - Default part of switch statement
Syntax
switch switch_expr
case case_expr
statement, ..., statement
case {case_expr1, case_expr2, case_expr3, ...}
statement, ..., statement
otherwise
statement, ..., statement
end
Description
otherwise is part of the switch statement
syntax, which allows for conditional execution. The statements following otherwise are
executed only if none of the preceding case expressions (case_expr)
matches the switch expression (sw_expr).
Examples
The general form of the switch statement is
switch sw_expr
case case_expr
statement
statement
case {case_expr1,case_expr2,case_expr3}
statement
statement
otherwise
statement
statement
endSee switch for more details.
See Also
switch, case, end, if, else, elseif, while
 | orth | | pack |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit