MATLAB Creating Graphical User Interfaces

(ff) #1

Examine the Code


(^1) In GUIDE, click the Editor button to view the code.
2
Near the top of the Editor window, use the Go To button to navigate to the
functions discussed below.
update_button_Callback
The update_button_Callback function executes when the user clicks the Update
Listbox button. It contains one command that calls another local function,
update_listbox. (That function is kept separate so it can be reused elsewhere in the
app.)
The update_listbox function executes the who command in the MATLAB workspace to
get the list of current variables. Then it sets the contents of the list box to that list of
variables.
vars = evalin('base','who');
set(handles.listbox1,'String',vars)
Plot Workspace Variables in a GUIDE App

Free download pdf