| MATLAB® | ![]() |
This section shows you how to write a script that creates the example graphical user interface (GUI) shown in the following figure.

The GUI contains
An axes
A pop-up menu listing three data sets that correspond to MATLAB® functions: peaks, membrane, and sinc
A static text component to label the pop-up menu
Three push buttons, each of which provides a different kind of plot: surface, mesh, and contour
To use the GUI, the user selects a data set from the pop-up menu, then clicks one of the plot-type push buttons. Clicking the button triggers the execution of a callback that plots the selected data in the axes.
The next topic, Function Summary, summarizes the functions used to create this example GUI.
Subsequent topics guide you through the process of creating the GUI. This process begins with Creating a GUI M-File. We recommend that you create the GUI for yourself.
If you are reading this in the MATLAB Help browser, you can click the following links to display the example GUI and its M-file.
Note The following links execute MATLAB commands and are designed to work within the MATLAB Help browser. If you are reading this online or in PDF, you should go to the corresponding section in the MATLAB Help Browser to use the links. |
![]() | Creating a Simple GUI Programmatically | Function Summary | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |