Two MATLAB® functions enable you to create COM objects:
actxcontrol — Creates
an instance of a control in a MATLAB figure.
actxserver — Creates and
manipulates objects from MATLAB that are exposed in an application
that supports Automation.
Each function returns a handle to the object's main interface, which you use to access the object's methods, properties, and events, and any other interfaces it provides.
In general, you can determine what you can do with an object
To list the methods supported by the object
To list the properties of the object
To see the value of the property
set function to change a property
To list the events supported by the object
To get the programmatic identifier (
of a COM control that is already registered on your computer, use
actxcontrollist command. You can also use
the ActiveX Control Selector, displayed with
actxcontrolselect. This interface
lets you see instances of the controls installed on your computer.
If your MATLAB program uses a custom control (e.g., one that you have created especially for your application), you must register it with the Microsoft® Windows® operating system before you can use it. You can do this from your MATLAB program by issuing an operating system command:
!regsvr32 /s filename.ocx
where filename is the name of the file containing the control. Using this command in your program enables you to provide custom-made controls that you make available to other users by registering the control on their computer when they run your MATLAB program. You might also want to supply versions of a Microsoft ActiveX® control to ensure that all users have the same version.