can a white space be included in a switch statement?
5 views (last 30 days)
Show older comments
good day! may I ask, can a ' ' or space be included in the switch statement.
For example
switch(var)
case 'Hello World'
end
is it possible? I really need to have two words for matching the expression var. thanks!
0 Comments
Answers (1)
Azzi Abdelmalek
on 23 Feb 2013
Edited: Azzi Abdelmalek
on 23 Feb 2013
Yes you can
a=' '
switch a
case ' '
d=10
case '1 2'
d=1000
end
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!