Write COM Applications to Work withMATLAB
Automation is a COM protocol that allows one application (thecontroller或者client) to control objects exported by another application (theserver). MATLAB supports COM Automation server capabilities on Microsoft®视窗®operating systems. Any Windows program that can be configured as an Automation client can control MATLAB. Some examples areMicrosoft Excel®和Microsoft Access™, as well asMicrosoft Visual Basic®和Microsoft Visual C++®程式。
To get started writing applications to call MATLAB as a COM Automation server:
Create a MATLAB serverin your application.
Learn how to map MATLAB data to COM types.
To call MATLAB functions,convert COM types to MATLAB types.
To use MATLAB data in your application,convert MATLAB types to COM types.
For examples, see:
如果使用C,C ++或FORTRAN构建客户端应用程序,请使用MATLAB引擎应用程序而不是自动化服务器。有关更多信息,请参阅Choosing Engine Applications.
To access COM components from MATLAB, seeUse COM Objects in MATLAB.
Functions
Topics
- Register MATLAB as COM Server
To use MATLAB as a COM server, register the application in the Windows registry.
- Create MATLAB Server
To create a server, use a programmatic identifier (ProgID) to identify the server.
- Convert MATLAB Types to COM Types
How MATLAB converts data from MATLAB types to COM types.
- 将COM类型转换为MATLAB类型
How MATLAB converts data from a COM application into MATLAB types.
- Call MATLAB Function from C# Client
This example shows how to call a user-defined MATLAB function from a C# application using MATLAB as an Automation server.
- Call MATLAB Function from Visual Basic .NET Client
This example calls MATLAB functions from aMicrosoft Visual Basicclient application.
- Pass Complex Data to MATLAB from C# Client
This example creates complex data in a client C# program and passes it to MATLAB.
Troubleshooting
Waiting for MATLAB Application to Complete
When you call a MATLAB function from another program, the program might display a timeout message while waiting for the MATLAB function to complete.