Need help using menu option
5 views (last 30 days)
Show older comments
choice1=menu('Choose first color of resistor','BLACK','BROWN','RED','ORANGE','YELLOW','GREEN','BLUE','VIOLET','GRAY','WHITE');
I am trying to assign these colors a certain value for each one. I want the menu to display the color names as well.
0 Comments
Answers (1)
Image Analyst
on 15 Oct 2013
Try this:
userSelection = menu('Choose first color of resistor',...
'BLACK','BROWN','RED','ORANGE','YELLOW',...
'GREEN','BLUE','VIOLET','GRAY','WHITE')
value = userSelection - 1
Your menu buttons already do display the color names, so there's nothing additional needed for that.
0 Comments
See Also
Categories
Find more on Workspace Variables and MAT-Files 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!