MATLAB Function Reference    
invoke (COM)

Invoke a method on an object or interface

Syntax

Arguments

h
   Handle for a COM object previously returned from actxcontrol, actxserver, get, or invoke.

methodname
   A string that is the name of the method to be invoked.

arg1, ..., argn
   Arguments, if any, required by the method being invoked.

Description

Invoke a method on an object's interface and retrieve the return value of the method, if any. The data type of the value is dependent upon the specific method being invoked and is determined by the specific control or server. If the method returns a COM interface, then invoke returns a new MATLAB COM object that represents the interface returned. See Converting Data in the External Interfaces documentation for a description of how MATLAB converts COM data types.

When you specify only a handle argument with invoke, MATLAB returns a structure array containing a list of all methods available for the object and their prototypes.

Examples

Create an mwsamp control and invoke its Redraw method:

Here is a simpler way to invoke. Just call the method directly, passing the handle, and any arguments:

Call invoke with only the handle argument to display a list of all mwsamp methods:

See Also

methods, ismethod


  invhilb ipermute