MATLAB Creating Graphical User Interfaces

(ff) #1

Callbacks for UIs without Code


Even when there is no code file associated with a UI FIG-file, you can still provide
callbacks for UI components to make them perform actions when used. In the Property
Inspector, you can type callbacks in the form of character vectors, built-in functions, or
MATLAB code file names; when your program runs, it will execute them if possible. If the
callback is a file name, it can include arguments to that function. For example, setting the
Callback property of a push button to sqrt(2) causes the result of the expression to
display in the Command Window:


ans =
1.4142


Any file that a callback executes must be in the current folder or on the MATLAB path.
For more information on how callbacks work, see “Write Callbacks in GUIDE” on page 7-
2


See Also


Related Examples



  • “GUIDE Preferences” on page 5-2


See Also
Free download pdf