Save mwsamp2 COM Control

This example shows how to restore original mwsamp2 control settings.

Create the mwsamp2 control.

f = figure('position',[100 200 200 200]);
h = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200],f);

Save the control settings to a new file, mwsample.

save(h,'mwsample')

Alter the figure by changing its label and the radius of the circle.

h.Label = 'Circle';
h.Radius = 50;
Redraw(h)

Restore the control to its original state.

load(h,'mwsample')

Verify the results.

get(h)
            Label: 'Label'
           Radius: 20
    Ret_IDispatch: [1x1 Interface.mwsamp2_ActiveX_Control_module._DMwsamp2]

MATLAB® displays the original settings.

Related Topics