Serialize control object to file
Create an mwsamp control and save its original state to the file mwsample:
f = figure('position',[100 200 200 200]); h = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200],f); save(h,'mwsample')
Now, alter the figure by changing its label and the radius of the circle.
h.Label = 'Circle'; h.Radius = 50; Redraw(h);
Using the load function, you can restore the control to its original state.
ans = Label: 'Label' Radius: 20