|
Department of Engineering |
|
|
Next: Program-generated names and commands
Up: Examples
Previous: Making holes
One of the properties of graphical objects (called ButtonDownFcn)
describes what happens if there's a mouse click on the object, thus
permitting complex user-interaction.
% This displays a simple figure and some buttons
% It needs a command called rotating to work
uicontrol('style','pushbutton','string','rotate',...
'ButtonDownFcn','rotating','Enable','off');
mesh(peaks(10))
Put this code into rotating.m
% rotaing.m
[az, el ] = view;
az=az+45;
view(az, el)