Main Content

matlab::engine::startMATLABAsync

Start MATLAB asynchronously

Description

FutureResult<std::unique_ptr<MATLABEngine>> startMATLABAsync(const std::vector<String>& options = std::vector<String>())

Start MATLAB® asynchronously in a separate process with optional MATLAB startup options.

Include

Namespace:

matlab::engine
IncludeMatlabEngine.hpp

Parameters

const std::vector<String>& options

Startup options used to launch MATLAB. You can specify multiple startup options. The engine supports all MATLAB startup options, except for the options listed in Unsupported Startup Options. For a list of options, see the platform-specific command matlab (Windows), matlab (macOS), or matlab (Linux).

Return Value

FutureResult<std::unique_ptr<MATLABEngine>>

A FutureResult object used to get the pointer to the MATLABEngine

Unsupported Startup Options

The engine does not support these MATLAB startup options:

  • -h

  • -help

  • -?

  • -n

  • -e

  • -softwareopengl

  • -logfile

For information on MATLAB startup options, see Commonly Used Startup Options.

Examples

expand all

Start MATLAB asynchronously and return a FutureResult object. Use the FutureResult to get a pointer to the MATLABEngine object.

FutureResult<std::unique_ptr<MATLABEngine>> matlabFuture = startMATLABAsync();
...
std::unique_ptr<MATLABEngine> matlabPtr = matlabFuture.get();

Version History

Introduced in R2017b