User`s guide

7 Save and Run a GUIDE GUI
Run a GUIDE GUI
In this section...
“Execute GUI Code” on page 7-10
“From the GUIDE Layout Editor” on page 7-10
“From the Command Line” on page 7-11
“From Any MATLAB Code File” on page 7-11
“From a Test Script” on p age 7-12
Execute GUI Code
In most cases, you run your GUI by executing the code file that GUIDE
generates by typing its name in the C ommand Window. This file loads the
GUI figure and provides a framework for the component callbacks. For more
information, see “Files Generated by GUIDE” on page 8-7.
Executing the code file raises a fully functional GUI. You can run a GUI in
three ways, as described in the following sections. The last section illustrates
how to test a GUI autom atically by invoking its callbacks from a M ATL AB
script.
Note You can display the GUI figure by double-clicking its file name in the
Current Folder Brow ser. You can also display it by executing
openfig, open,
or
hgload. These functions load a FIG -file into the MATLAB workspace and
open the figure for viewing. If the displayed figure is a GU ID E GUI, you can
manipulate its components, but nothing happens because no corresponding
code file is running to initialize the GUI or execute component callbacks.
From the GUIDE Layout Editor
Run your GUI from the GUIDE Layout Editor by:
Clicking the
button on the Layout Editor toolbar
Selecting Run from the Tools menu
7-10