| MATLAB Function Reference | Search  Help Desk |
| otherwise | Examples See Also |
Default part of switch statement
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) match the switch expression (sw_expr).
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
end
See switch for more details.
switch Switch among several cases based on expression