Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

MATLAB COM Automation Server

Call MATLAB® from COM components and applications

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 application using C/C++, or Fortran, use MATLAB Engine API for C, C++, and Fortran instead of an Automation server.

Functions

Execute Execute MATLAB command in Automation server
Feval Evaluate MATLAB function in Automation server
GetCharArray Character array from Automation server
PutCharArray Store character array in Automation server
GetFullMatrix Matrix from Automation server workspace
PutFullMatrix Matrix in Automation server workspace
GetVariable Data from variable in Automation server workspace
GetWorkspaceData Data from Automation server workspace
PutWorkspaceData Data in Automation server workspace
MaximizeCommandWindow Open Automation server window
MinimizeCommandWindow Minimize size of Automation server window
Quit Terminate MATLAB Automation server
regmatlabserver Register current MATLAB as Automation server
enableservice Enable, disable, or report status of MATLAB Automation server

Examples and How To

Call MATLAB Function from Visual Basic .NET Client

This example calls a user-defined MATLAB function named solve_bvp 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.

Launch MATLAB as Automation Server in Desktop Mode

To launch 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.

Concepts

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 COM.date.

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.

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.

Related Information

Was this topic helpful?