Specifications

4 Programming GUIs
4-22
handles.activex1.radius = ...
get(hObject, 'Value')*handles.default_radius;
handles.activex1.label = ...
['Radius = ' num2str(handles.activex1.radius)];
refresh(handles.figure1);
4 Add the following command to the opening function:
handles.default_radius = handles.activex1.radius;
5 Add the following command at the end of the code in the activex1_Click
callback:
set(handles.slider1, 'Value', ...
hObject.radius/handles.default_radius);
6 Run the GUI.
When you move the slider by clicking and dragging, the radius changes to a
new value between 0 and the default radius of 20, as shown in the following
figure.
The command
handles.activex1.radius = ...
get(hObject, 'Value')*handles.default_radius;
does the following: