Contents

set (COM)

Set object or interface property to specified value

Syntax

set(h,'pname',value)
set(h,'pname1',value1,'pname2',value2,...)

Description

set(h,'pname',value) sets the property specified in the string pname to the given value.

set(h,'pname1',value1,'pname2',value2,...) sets each property specified in the pname strings to the given value.

For information on how MATLAB® converts workspace matrices to COM data types, see Handling COM Data in MATLAB Software.

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

Examples

Create an mwsamp control and use set to change the Label and Radius properties:

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

set(h,'Label','Click to fire event','Radius',40);
invoke(h,'Redraw');

Here is another way to do the same thing, only without set and invoke:

h.Label = 'Click to fire event';
h.Radius = 40;
Redraw(h);
Was this topic helpful?