Switch case inside of another switch case

Réponses (1)

Sean de Wolski
Sean de Wolski le 30 Déc 2014
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 commentaire

Jan
Jan le 30 Déc 2014
Modifié(e) : Jan le 30 Déc 2014
+1. A complete answer although it is trivial.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Report Generator dans Centre d'aide et File Exchange

Question posée :

le 30 Déc 2014

Modifié(e) :

Jan
le 30 Déc 2014

Community Treasure Hunt

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

Start Hunting!

Translated by