User`s guide
GUI for Animating a 3-D View (GUIDE)
Function
Function Behavior
sunazslider_CreateFcn
Initializes light source azimut h
slider (not customized)
sunelslider_Callback
Changes elevation of light source as
user moves slider
sunelslider_CreateFcn
Initializes light source elevation
slider (not customized)
showgridbutton_Callback
Toggles th e graticul e grid v isibility
movie_checkbox_Callback
Toggles capturing and saving a
movie of the animation
movie_checkbox_CreateFcn
Initializes the movie button and
saves i ts value
Alternate the Label of a push Button
The top right button, initially labeled Spin, changes to Stop when clicked,
and back to Spinclicked a second time. It does this by comparing its
String
property to a pair of strings stored in the ha ndle s structure as a cell array.
Insert this data into the handles structure in
spinstopbutton_CreateFcn,as
follows:
function spinst opbu tton_CreateFcn(hObject, eventdata, handles)
handles.Strings = {'Spin';'Stop'};
guidata(hObject, handles);
The call to guidata saves the updated handles structure for the figure
containing
hObject,whichisthespinstop button push button obje ct.
GUIDE named this object
pushbutton1. It was renamed by changing its
Tag property in the Property Inspector. As a result, GUIDE changed all
references to the component in the GUI’ code file when the GUI w as saved.
For m ore information on setting tags, see “Identify the Axes” on page 10-6 in
the previous example.
The
handles.Strings data is used in the spinstopbutton_Callback
function, which includes the following code for changing the label of the
button:
10-21