Specifications

Programming Callbacks for GUI Components
4-21
refresh(handles.figure1);
4 Add the following command to the opening function:
handles.activex1.label = ...
['Radius = ' num2str(handles.activex1.radius)];
5 Run the GUI.
Now, each time you click the ActiveX control, the radius of the circle is reduced
by 10 percent and the new value of the radius is displayed, as shown in the
following figure.
G
GUI After Clicking the Circle Six Times
If you click the GUI enough times, the circle disappears entirely.
Adding a Uicontrol to Change an ActiveX Control Property
You can also add other Uicontrols to the GUI to change the properties of an
ActiveX control. For example, you can add a slider that changes the radius of
the circle in the Mwsamp GUI. To do so,
1 Drag a slider into the layout area.
2 Right-click the slider and select M-file Editor.
3 Add the following command to the slider1 callback: