MATLAB Function Reference | Search  Help Desk |
case | Examples See Also |
case
is part of the switch
statement syntax, which allows for conditional execution.
A particular case consists of the case
statement itself, followed by a case expression, and one or more statements.
A case is executed only if its associated case expression (case_expr
) is the first to match the switch expression (switch_expr
).
The general form of the switch
statement is:
switch switch_expr case case_expr statement,...,statement case {case_expr1,case_expr2,case_expr3,...} statement,...,statement ... otherwise statement,...,statement endSee
switch
for more details.
switch
Switch among several cases based on expression