Switch case inside of another switch case

回答(1 个)

x = 2;
y = 3;
switch x
case 1
disp 1
case 2
switch y
case 2
disp Ha!
case 3
disp HaHa!
otherwise
disp Nah
end
end

1 个评论

Jan
Jan 2014-12-30
编辑:Jan 2014-12-30
+1. A complete answer although it is trivial.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 MATLAB Report Generator 的更多信息

提问:

2014-12-30

编辑:

Jan
2014-12-30

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by