External Interfaces |
Identifying Objects
Use these MATLAB functions to get information about a COM object.
Function |
Description |
class |
Return the class of a COM object |
isa |
Detect a COM object of a given class |
isevent |
Determine if an item is an event of a COM object |
ismethod |
Determine if an item is a method of a COM object |
isprop |
Determine if an item is a property of a COM object |
Create a COM object, h
, in an Automation server running Excel, and also a Workbooks
interface, w
, to the object:
To find out the class of variable w
, use the class
function:
To test a variable against a known class name, use isa
:
To see if UsableWidth
is a property of object h
, use isprop
:
To see if SaveWorkspace
is a method of object h
, use ismethod
. Method names are case sensitive and cannot be abbreviated:
Create the sample mwsamp2
control that comes with MATLAB, and use isevent
to see if DblClick
is one of the events that this control recognizes:
f = figure ('position', [100 200 200 200]); h = actxcontrol ('mwsamp.mwsampctrl.2', [0 0 200 200], f); h.isevent('DblClick') ans = 1
Releasing COM Interfaces and Objects | Examples of MATLAB as an Automation Client |
© 1994-2005 The MathWorks, Inc.