Automation is a COM protocol that allows one application (the controller or client) to control objects exported by another application (the server). MATLAB supports COM Automation server capabilities on Microsoft® Windows® operating systems. Any Windows program that can be configured as an Automation controller can control MATLAB. Some examples are Microsoft Excel® and Microsoft Access™, and many Microsoft Visual Basic® and Microsoft Visual C++® programs.
If you build client applications using C/C++, or Fortran, then use MATLAB Engine Applications instead of an Automation server.
|Matrix from Automation server workspace|
|Matrix in Automation server workspace|
|Character array from Automation server|
|Character array in Automation server|
|Data from variable in Automation server workspace|
|Data from Automation server workspace|
|Data in Automation server workspace|
To use MATLAB as an Automation server, register the application in the Windows registry.
To create a server, use a programmatic identifier (ProgID) to identify the server.
To create a MATLAB server manually, use the
-automation switch in
matlab startup command.
To start MATLAB as a COM Automation server in full desktop mode, use the programmatic
It is not always necessary to create a new instance of a MATLAB server.
Visible property to make MATLAB visible in a server application.
Automation Server concepts.
This example shows how to call a user-defined MATLAB function from a C# application.
This example calls MATLAB functions from a Microsoft Visual Basic client application.
Use Microsoft Visual Basic Object Browser to display methods available from a MATLAB Automation server.
How MATLAB converts data from MATLAB types to COM types.
How MATLAB converts data from a COM application into MATLAB types.
Data types for arguments and return values of server functions are expressed as Automation data types — language-independent types defined by the Automation protocol.
This example creates complex data in the client C# program and passes it to MATLAB.
To pass a
VT_DATE type input to a Visual Basic program or an ActiveX® control method, use the MATLAB class
When you call a MATLAB function from another program, the program might display a timeout message while waiting for the MATLAB function to complete.