
7 Saving and Running the GUI
7-12
Saving and Displaying Only the GUI Layout
• “Saving a GUI Layout Only” on page 7-12
• “Displaying a GUI Layout Only” on page 7-12
Saving a GUI Layout Only
The FIG-file contains the layout of your GUI. You might choose to save only the
layout if it is not yet complete and you want to save your work without
generating the M-file. To save only the FIG-file for your GUI:
1 Select Options from the Layout Editor View menu, then select Generate
FIG-file only
. Note that GUIDE can also select this option.
2 Save the GUI using the Save or Save As item from the File menu.
The
Generate FIG-file only option also allows you to create your own M-file –
one that may use a completely different programming style than that provided
by the GUIDE M-file.
GUIDE Selects the FIG-File Only Option
GUIDE selects Generate FIG-file only as the default if, when you start
GUIDE, you provide the name of a FIG-file or the handle of a figure for which
a FIG-file exists. For example,
guide('mygui.fig')
The figure, mygui.fig, need not be generated using GUIDE. See the guide
command for more information.
Displaying a GUI Layout Only
You can display a copy of a GUI figure in the GUIDE Layout Editor using the
openfig, open, or hgload command. These commands load FIG-files into the
MATLAB workspace. Note that the displayed GUI is not active.
This mode provides limited editing capability and may be useful for GUIs
generated in MATLAB versions 5.3 and earlier.
As an example, if your FIG-file is
mygui.fig, you can display the layout using
any of the following commands:
Commentaires sur ces manuels