User`s guide
Run a GUIDE GUI
In either case, if the GUI has changed or has never been saved, GUID E saves
the GUI files before activating it and opens the GUI code file in your default
editor. See “Save a GUIDE GUI” on page 7-4 for information about this
process. See “Files Generated by GUIDE” on page 8-7 for more information
about GUI code files.
From the Command Line
Run your GUI by executing its code file. For example, if your GUI code file is
mygui.m,enter:
mygui
at the command line. The files must reside on your path or in your current
folder. If you want the GUI to be invisible when it opens, enter:
mygui('Visible','off')
If a GUI accepts arguments when it is run, they are passed to the GUI’s
opening function. See “Opening Function” on page 8-25 for m ore information.
Note Consider whether you want to allow more than one copy of the GUI
to be active at the same time. If you want only one GUI to be active, select
Options > GUI Allows Only One Instance to R un (Singleton) from
the Layout Editor View menu. See “GUI Options” on page 5-9 for more
information.
From Any MATLAB Code File
Run your GUI from a script or function file by executing the GUI code file.
Forexample,ifyourGUIcodefileis
mygui.m, include the following statement
in the script or function that invokes it.
mygui
If you want the GUI to be invisible when it opens, use this statement:
mygui('Visible','off')
7-11