External Interfaces Previous page   Next Page

Connecting to an Existing Server

It is not always necessary to create a new instance of a MATLAB server whenever your application needs some task done within MATLAB. Clients can connect to an existing MATLAB automation server using a command similar to the Visual Basic GetObject command.

The Visual Basic command shown here returns a handle h to MATLAB server application:

The sample Visual Basic code shown here connects to an existing MATLAB server, and then executes a plot command in the server. If you do not already have a MATLAB server running, then you can create one following the instructions in Creating the Automation Server.

Then, enter the following code in a Visual Basic program to connect to the server and have MATLAB draw a simple plot:


Previous page  MATLAB Automation Server Support Automation Server Functions Next page

© 1994-2005 The MathWorks, Inc.