This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Invoke method on COM object or interface, or display methods


S = invoke(c,methodName)
S = invoke(c,methodName,arg1,...,argN)



invoke(c) displays methods supported by object or interface c, along with the prototypes for these methods. If the output is empty, then either there are no properties or methods in the object, or MATLAB® cannot read the object type library. For information about the object type library, see your COM vendor documentation.


S = invoke(c,methodName) invokes the method specified by methodName and returns an output value, if any, in a structure array. The method determines the data type of the return value. For a description of how MATLAB converts COM types, see Handle COM Data in MATLAB.

If the method returns a COM interface, then the invoke function returns a new MATLAB COM object that represents the interface.

S = invoke(c,methodName,arg1,...,argN) invokes methodName with input arguments arg1,...,argN.


collapse all

Create the mwsamp control in a figure window.

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

Display its methods.

	Beep = void Beep(handle)
	Redraw = void Redraw(handle)
	GetVariantArray = Variant GetVariantArray(handle)
	GetIDispatch = handle GetIDispatch(handle)
	GetBSTR = ustring GetBSTR(handle)
	GetI4Array = Variant GetI4Array(handle)
	GetBSTRArray = Variant GetBSTRArray(handle)
	GetI4 = int32 GetI4(handle)
	GetR8 = double GetR8(handle)
	GetR8Array = Variant GetR8Array(handle)
	FireClickEvent = void FireClickEvent(handle)
	GetVariantVector = Variant GetVariantVector(handle)
	GetR8Vector = Variant GetR8Vector(handle)
	GetI4Vector = Variant GetI4Vector(handle)
	SetBSTRArray = Variant SetBSTRArray(handle, Variant)
	SetI4 = int32 SetI4(handle, int32)
	SetI4Vector = Variant SetI4Vector(handle, Variant)
	SetI4Array = Variant SetI4Array(handle, Variant)
	SetR8 = double SetR8(handle, double)
	SetR8Vector = Variant SetR8Vector(handle, Variant)
	SetR8Array = Variant SetR8Array(handle, Variant)
	SetBSTR = ustring SetBSTR(handle, ustring)
	AboutBox = void AboutBox(handle)

Change the Radius property and redraw the control.

c.Radius = 100;

Input Arguments

collapse all

COM object or interface, specified as a function handle.

Control method name, specified as a string or a character vector.

Example: invoke(c,'Redraw')

Control method input arguments, 1 through N (if any), required by methodName, specified by any type. The method argument list specifies the argument type.

Introduced before R2006a