Owning Class: programming
Requires: MathScript RT Module
otherwise
Specifies a default case in a switch statement. The principal calling structure of a switch statement is:
switch expression
case expression
statement, ... , statement
...
otherwise
statement, ... , statement
end
The otherwise case is optional.
color = 'green';
switch color
case 'green'
disp('color is green');
case 'red'
disp('color is red');
otherwise
disp('color is neither green nor red')
end