MATLAB Function Reference | Search  Help Desk |
menu | Examples See Also |
Generate a menu of choices for user input
k=
menu('mtitle','opt1','opt2',...,'optn')
k = menu('mtitle','opt1
','opt2
',...,'optn
')
displays the menu whose title is in the string variable '
mtitle'
and whose choices are string variables 'opt1', 'opt2', and so on. menu
returns the value you entered.
To call menu
from another ui-object, set that object's Interruptible
property to 'yes'
. For more information, see the MATLAB Graphics Guide.
k = menu('Choose a color','Red','Green','Blue')
displays
After input is accepted, use k
to control the color of a graph.
colorThe=
['r'
,
'g',
'b'] plot(t,s,color(k))
uicontrol
command in the MATLAB Graphics Guide, and:
input
Request user input