Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Create MATLAB Server

Getting Started

To create a server, you need a programmatic identifier (ProgID) to identify the server. The ProgID for MATLAB® is matlab.application. For a complete list, see Programmatic Identifiers.

How you create an Automation server depends on the controller you are using. Consult your controller's documentation for this information. Possible options include:

  • Add this statement to a Visual Basic® .NET application.

    MatLab = CreateObject("Matlab.Application")
  • Manually Create Automation Server.

  • Use the Visual Basic Object Browser to access methods.

Access Methods from the Visual Basic Object Browser

You can use the Object Browser of your Visual Basic client application to see what methods are available from a MATLAB Automation server. To do this you need to reference the MATLAB type library in your Visual Basic project.

To set up your Visual Basic project:

  1. Select the Project menu.

  2. Select Reference from the subsequent menu.

  3. Check the box next to the MATLAB Application Type Library.

  4. Click OK.

In your Visual Basic code, use the New method to create the server:

Matlab = New MLApp.MLApp

View MATLAB Automation methods from the Visual Basic Object Browser under the Library called MLAPP.

Get or Set the Status of a MATLAB Automation Server

To make MATLAB an Automation server, use the enableservice function. For example, type:

enableservice('AutomationServer',true)

To determine the current state of a MATLAB Automation server. type:

enableservice('AutomationServer')

If MATLAB displays:

ans =
     1

then MATLAB is currently an Automation server.

See Also

Related Examples

More About

Was this topic helpful?