Contents

load (COM)

Initialize control object from file

Syntax

load(h,'filename')

Description

load(h,'filename') initializes the COM object associated with the interface represented by the MATLAB® COM object h from file specified in the string filename. The file must have been created previously by serializing an instance of the same control.

COM functions are available on Microsoft® Windows® systems only.

    Note   The COM load function is only supported for controls at this time.

Examples

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.

load(h,'mwsample');
get(h)
ans = 
     Label: 'Label'
    Radius: 20
Was this topic helpful?