
6 Laying Out a GUI
6-2
Designing a GUI
Before creating the actual GUI, it is important to decide what it is you want
your GUI to do and how you want it to work. It is helpful to draw your GUI on
paper and envision what the user sees and what actions the user takes.
Note MATLAB provides a selection of standard dialog boxes that you can
create with a single function call. For information about these dialog boxes
and the functions used to create them, see Predefined Dialog Boxes in the
MATLAB documentation.
The GUI used in this example contains an axes that displays either a surface,
mesh, or contour plot of data selected from the pop-up menu. The following
picture shows a sketch that you might use as a starting point for the design.
A panel contains three push buttons that enable you to select the type of plot
you want. The pop-up menu contains three strings —
peaks, membrane, and
sinc, which correspond to MATLAB functions. You can select the data to plot
from this menu.
Select Data
peaks
Contour
Mesh
Surf
Axes
Push buttons to select
plot type
Menu for selecting
data
Plot Types
Panel to group push
buttons
Commenti su questo manuale