MATLAB Creating Graphical User Interfaces

(Barry) #1
Structure of Programmatic UI Code Files

% Initialization tasks


% Construct the components


% Initialization tasks


% Callbacks for MYUI


% Utility functions for MYUI


end


Save the file in your current folder or at a location that is on your MATLAB path.


Run the Program


You can display your UI at any time by executing the code file. For example, if your UI
code file is myui.m, type


myui


at the command line. Provide run-time arguments as appropriate. The file must reside on
your path or in your current folder.


When you execute the code, a fully functional copy of the UI displays on the screen. If the
file includes code to initialize the UI and callbacks to service the components, you can
manipulate components that it contains.

Free download pdf