Using 'OR' operator with 'case' statement
68 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdullah
am 29 Jan. 2019
Beantwortet: Kevin Phung
am 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 Kommentare
Akzeptierte Antwort
Kevin Phung
am 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Automated Driving Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!