Specifications

Creating GUIs with GUIDE
2-3
Creating GUIs with GUIDE
MATLAB implements GUIs as figure windows containing various styles of
uicontrol objects. You must program each object to perform the intended action
when activated by the user of the GUI. In addition, you must be able to save
and launch your GUI. All of these tasks are simplified by GUIDE, MATLAB’s
graphical user interface development environment.
GUI Development Environment
The process of implementing a GUI involves two basic tasks:
Laying out the GUI components
Programming the GUI components
GUIDE primarily is a set of layout tools. However, GUIDE also generates an
M-file that contains code to handle the initialization and launching of the GUI.
This M-file provides a framework for the implementation of the callbacks – the
functions that execute when users activate components in the GUI.
The Implementation of a GUI
While it is possible to write an M-file that contains all the commands to lay out
a GUI, it is easier to use GUIDE to lay out the components interactively and to
generate two files that save and launch the GUI:
A FIG-file – contains a complete description of the GUI figure and all of its
children (uicontrols and axes), as well as the values of all object properties.
An M-file – contains the functions that launch and control the GUI and the
callbacks, which are defined as subfunctions. This M-file is referred to as the
application M-file in this documentation.
Note that the application M-file does not contain the code that lays out the
uicontrols; this information is saved in the FIG-file.
The following diagram illustrates the parts of a GUI implementation.