menu

Purpose

Generate a menu of choices for user input.

Synopsis

k = menu('mtitle','opt1','opt2',...,'optn')

Description

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.

Examples

k = menu('Choose a color','Red','Green','Blue') displays

---- Choose a color ----
          
    1) Red
    2) Green
    3) Blue
          
Select a menu number:
After you input a number, use k to control the color of a graph.

color = ['r','g','b']
plot(t,s,color(k))
Computers that employ a window system use a bitmapped menu.

See Also

demo, input, uicontrol

(c) Copyright 1994 by The MathWorks, Inc.