This keyword specifies a switch block. This is similar to an "if" statement with several "elseif" parts. We compare the expression following the switch keyword, and try to match it to one of the "case" values. If none of them match, we will select the "otherwise" block, if it exists.
a = 2;
switch (a)
case 1
disp('one');
case 2
disp('two');
otherwise
disp('not one or two');
end
two