Using 'OR' operator with 'case' statement
67 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Abdullah
le 29 Jan 2019
Réponse apportée : Kevin Phung
le 29 Jan 2019
Is it good programming practice to use 'OR' operator with 'case' statement. I want to associate multiple values of 'switch' statement with each 'case' statement like below.
switch value
case 1|2|3
execute this
case 4|5|6
execute this
end
0 commentaires
Réponse acceptée
Kevin Phung
le 29 Jan 2019
This would be the proper way for using or:
switch value
case {1,2,3}
% execute this
case {4,5,6}
% execute this
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Automated Driving Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!