Specifications
Laying Out the GUI
2-3
Laying Out the GUI
This section illustrates how to lay out GUI components (i.e., a panel, axes, and
user interface controls, such as push buttons, pop-up menus, static text, etc.)
in the GUI. We recommend that you create the GUI for yourself, as this is the
best way to learn how to use GUIDE.
The section explains how to
• “View Layout and Code for the Example” on page 2-3
• “Open a New GUI in the Layout Editor” on page 2-4
• “Set the GUI Figure Size” on page 2-6
• “Add the Components” on page 2-7
• “Align the Components” on page 2-9
View Layout and Code for the Example
If you are reading this in the MATLAB Help browser, you can click the
following links to display the GUIDE Layout Editor and the MATLAB Editor
with a completed version of this example. This enables you to see the values of
all component properties and to understand how the components are
assembled to create the GUI. You can also see a complete listing of the code
that is discussed in the following sections.
Note The following links execute MATLAB commands and are designed to
work within the MATLAB Help browser.
• Layout Editor with completed GUI layout
• MATLAB Editor with completed M-file. The M-file contains the code that
controls the GUI.
An Animated Demo of Creating a GUI
The following link displays an animated version of this example.
Show GUIDE demonstration