User`s guide

Files Generated by GUIDE
Files Generated by GUIDE
In this section...
“Code Files and FIG-Files” on page 8-7
“GUI Code File Structure” on page 8-8
“Adding Callback Templates to an Existing GUI Code File” on page 8-9
“About GUIDE-Generated Callbacks” on page 8-9
Code Files and FIG-Files
By default, the first time you save or run a GUI, GUIDE stores the GUI in
two files:
A FIG-file, with extension
.fig, that contains a complete description of the
GUI layout and each GUI component, such as push buttons, axes, panels,
menus, and so on. The FIG-file is a binary file and you cannot modify it
except by changing the layout in GUIDE. FIG-files are specializations of
MAT-files. See “Custom Applications to Read and Write MAT-Files” for
more information.
A code file, with e x tension
.m, that initially contains initialization c od e an d
templates for some callbacks that control GUI behavior. You generally add
callbacks you write for your GUI components to this file. As the callbacks
are functions, the GUI code file can never be a MATLAB script.
When you save your G UI the first time, GUIDE automatically opens the
code file in your default editor.
TheFIG-fileandthecodefilemusthavethesamename. Thesetwofiles
usually reside in the same folder, and correspond to the tasks of laying out
and programming the GUI. When you lay o ut the GUI in the L ayout Editor,
your components and layout is stored in the FIG-file. When you program the
GUI, your code is stored in the corresponding code file.
If your GUI includes ActiveX components, GUIDE also generates a file
for each ActiveX component. See “ActiveX Control” on page 8-49 for more
information.
8-7