Contents

MATLAB COM Automation Server Interface

Automation is a COM protocol that allows one application (the controller or client) to control objects exported by another application (the server). MATLAB® software on Microsoft® Windows® operating systems supports COM Automation server capabilities. Any Windows program that can be configured as an Automation controller can control MATLAB. Some examples of applications that can be Automation controllers are Microsoft Excel®, Microsoft Access™, and Microsoft Project applications, and many Microsoft Visual Basic® and Microsoft Visual C++® programs.

COM Server Types

There are three types of COM servers:

  • Automation — A server that supports the OLE Automation standard. Automation servers are based on the IDispatch interface. Automation servers can be accessed by clients of all types, including scripting clients.

  • Custom — A server that implements an interface directly derived from IUnknown. Custom servers are preferred when faster client access is critical.

  • Dual — A server that implements a combination of Automation and Custom interfaces.

Shared and Dedicated Servers

The MATLAB Automation server has two modes:

  • Shared — One or more client applications connect to the same MATLAB server. All clients share the same server.

  • Dedicated — Each client application creates its own dedicated MATLAB server.

If you use matlab.application as your ProgID, MATLAB creates a shared server. For more information, see Specifying Shared or Dedicated Server.

Programmatic Identifiers

To create an instance of a COM object, you use its programmatic identifier, or ProgID. The ProgID is a unique string defined by the component vendor to identify the COM object. You obtain a ProgID from the vendor's documentation.

The MATLAB ProgIDs for shared servers are:

  • Matlab.Application — Starts a command window Automation server with the version of MATLAB that was most recently used as an Automation server (might not be the latest installed version of MATLAB).

  • Matlab.Autoserver — Starts a command window Automation server using the most recent version of MATLAB.

  • Matlab.Desktop.Application — Starts the full desktop MATLAB as an Automation server using the most recent version of MATLAB.

The ProgIDs for dedicated servers are:

  • Matlab.Application.Single

  • Matlab.Autoserver.Single

These version-independent MATLAB ProgIDs specify the currently-installed and registered version of MATLAB.

In order to create an instance of a specific installed and registered MATLAB version, you can use a version-dependent ProgID. For example, using the ProgID Matlab.Application.7.14 creates an instance of MATLAB version 7.14 (R2012a).

In-Process and Out-of-Process Servers

You can configure a server three ways. MATLAB supports all of these configurations.

In-Process Server

An in-process server is a component implemented as a dynamic link library (DLL) or ActiveX® control that runs in the same process as the client application, sharing the same address space. Communication between client and server is relatively fast and simple.

Local Out-of-Process Server

A local out-of-process server is a component implemented as an executable (EXE) file that runs in a separate process from the client application. The client and server processes are on the same computer system. This configuration is somewhat slower due to the overhead required when transferring data across process boundaries.

Remote Out-of Process Server

This is a type of out-of-process server; however, the client and server processes are on different systems and communicate over a network. Network communications, in addition to the overhead required for data transfer, can make this configuration slower than the local out-of-process configuration. This configuration runs only on systems that support the Distributed Component Object Model (DCOM).

Was this topic helpful?