Skip to Main Content Skip to Search
Product Documentation

load (COM) - Initialize control object from file

Syntax

h.load('filename')
load(h, 'filename')

Description

h.load('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.

load(h, 'filename') is an alternate syntax for the same operation.

Tips

COM functions are available on Microsoft Windows systems only.

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);
h.save('mwsample')

Now, alter the figure by changing its label and the radius of the circle:

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

Using the load function, you can restore the control to its original state:

h.load('mwsample');
h.get

MATLAB displays the original values:

ans = 
     Label: 'Label'
    Radius: 20

See Also

actxcontrol | actxserver | delete (COM) | release | save (COM)

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS