User`s guide
GUI with Axes, Menu, and Toolbar
Note MATLAB software automatically passes hUpdateButtonCallback
two arguments, hObjec t and ev entd ata,becausetheUpdate push button
component
Callback property, @hUpdate ButtonCallback,isdefinedasa
function handle.
hObject contains the handle of the component that triggered
execution of the callback.
eventdata is reserved for future use. The function
definition line for your callback must account for these two arguments.
Open Menu Item Callback
The hOpenMenuitemCallback function services the Open menu item and
the Open toolbar button
. Selecting the menu item or clicking the toolbar
button triggers the execution of this callback function.
function hOpenM enui temCallback(hObject, eventdata)
% Callback function run whe n the Open menu item is selected
file = uigetfile('*.m');
if ~isequal(fil e, 0)
open(file);
end
end
15-15