Using 'OR' operator with 'case' statement
67 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Abdullah
el 29 de En. de 2019
Respondida: Kevin Phung
el 29 de En. de 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 comentarios
Respuesta aceptada
Kevin Phung
el 29 de En. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Automated Driving Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!