This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

MATLAB API for COM Automation Server

Write COM applications to work with MATLAB®

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.


actxGetRunningServerHandle to running instance of Automation server
enableserviceEnable, disable, or report status of MATLAB Automation server
ExecuteExecute MATLAB command in Automation server
FevalEvaluate MATLAB function in Automation server
GetCharArrayCharacter array from Automation server
GetFullMatrixMatrix from Automation server workspace
GetVariableData from variable in Automation server workspace
GetWorkspaceDataData from Automation server workspace
MaximizeCommandWindowOpen Automation server window
MinimizeCommandWindowMinimize size of Automation server window
PutCharArrayStore character array in Automation server
PutFullMatrixMatrix in Automation server workspace
PutWorkspaceDataData in Automation server workspace
QuitTerminate MATLAB Automation server
regmatlabserverRegister current MATLAB as Automation server

Examples and How To

Call MATLAB Function from Visual Basic .NET Client

This example calls MATLAB functions from a Microsoft Visual Basic client application through a COM interface.

Call MATLAB Function from C# Client

This example shows how to call a user-defined MATLAB function, myfunc, from a C# application.

Pass Complex Data to MATLAB from C# Client

This example creates complex data in the client C# program and passes it to MATLAB.

View MATLAB Functions from Visual Basic .NET Object Browser

You can find out what methods are available from a MATLAB Automation server using the Object Browser of your Microsoft Visual Basic client application.

Start MATLAB as Automation Server in Desktop Mode

To start MATLAB as a COM Automation server in full desktop mode, use the programmatic identifier Matlab.Desktop.Application.

Manually Create Automation Server

Microsoft Windows operating system automatically creates an Automation server when a controller application first establishes a server connection.


Register MATLAB as Automation Server

To use MATLAB as an Automation server, you first must register the application in the Windows registry, which happens when you install a new version of MATLAB.

MATLAB COM Automation Server Interface

How to configure MATLAB software as a COM Automation server

Create MATLAB Server

To create a server, you need a programmatic identifier (ProgID) to identify the server.

Connect to Existing MATLAB Server

It is not always necessary to create a new instance of a MATLAB server whenever your application needs some task done in MATLAB.

Conversion of MATLAB Types to COM Types

How MATLAB converts data from MATLAB types to COM types.

Conversion of COM Types to MATLAB Types

How MATLAB converts data from a COM application into MATLAB types.

Shared or Dedicated Server

You can start the MATLAB Automation server in one of two modes – shared or dedicated.

VT_DATE Data Type

To pass a VT_DATE type input to a Visual Basic program or an ActiveX® control method, use the MATLAB class

Data Types For Visual Basic .NET Clients

Data types for arguments and return values of server functions are expressed as Automation data types — language-independent types defined by the Automation protocol.

Visible Property

Use the Visible property to make MATLAB visible in a server application.

MATLAB Application as DCOM Server

Distributed Component Object Model (DCOM) is a protocol that allows COM connections to be established over a network.


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.

Related Information