Main Content

engOpenSingleUse (C)

Start MATLAB engine session for single, nonshared use

C Syntax

#include "engine.h"
Engine *engOpenSingleUse(const char *startcmd, void *dcom,
  int *retstatus);



String to start MATLAB® process. On Microsoft® Windows® systems, the startcmd string must be NULL.


Reserved for future use; must be NULL.


Return status; possible cause of failure.


Microsoft Windows Operating Systems Only

Pointer to an engine handle, or NULL if the open fails.

UNIX Operating Systems

Not supported on UNIX® systems.


This routine allows you to start multiple MATLAB processes using MATLAB as a computational engine.

engOpenSingleUse starts a MATLAB process, establishes a connection, and returns a unique engine identifier, or NULL if the open fails. Each call to engOpenSingleUse starts a new MATLAB process.

engOpenSingleUse opens a COM channel to MATLAB. This starts the MATLAB software you registered during installation. If you did not register during installation, enter the following command at the MATLAB prompt:

!matlab -regserver

engOpenSingleUse allows single-use instances of an engine server. engOpenSingleUse differs from engOpen, which allows multiple applications to use the same engine server.

See MATLAB COM Integration for additional details.