User`s guide
7 Save and Run a GUIDE GUI
NameaGUIandItsFiles
In this section...
“The GUI Files” on page 7-2
“File and GUI Names” on page 7-3
“Rename GUIs and GUI Files” on page 7-3
The GUI Files
By default, GUIDE stores a GUI in two files which are generated the first
time you save o r run the GUI:
• A MATLAB FIG-file, with extension
.fig, that contains a complete
description of the GUI layout and the GUI components, such as push
buttons, axes, panels, menus, and so on. The FIG-file is a binary file and
you cannot modify it except by changin g th e layout in GUIDE. Note that a
FIG-file is a kind of MAT-file.
• A MATLAB function file, with extension
.m, that contains the code that
controls the GUI, including the callbacks for its components.
Thesetwofileshavethesamenameandusuallyresideinthesamefolder.
They correspond to the tasks of laying out and programming the GUI. When
you lay out the GUI in the Layout Editor, your work is stored in the FIG-file.
When you program the GUI, your w ork is stored in the corresponding code file.
Note GUI code files created by GUIDE always contain functions that the
FIG-file calls when the user loads it and operates the GUI. They are never
scripts (sequences of MATLAB commands that can be executed but do not
define functions).
Note that if your GUI includes ActiveX components, GUIDE also generates
a file for each ActiveX co mponent. See “ActiveX Co ntro l” on page 8-49 fo r
more information.
7-2