matlab::engine::startMATLAB - Start MATLAB synchronously - MATLAB (original) (raw)

Main Content

Start MATLAB synchronously

Description

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

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

Include

Namespace: matlab::engine
Include MatlabEngine.hpp

Parameters

Return Value

std::unique_ptr Pointer to the MATLABEngine object

Exceptions

matlab::engine::EngineException MATLAB failed to start.

Unsupported Startup Options

The engine does not support these MATLAB startup options:

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

Examples

expand all

Start MATLAB synchronously and return a unique pointer to theMATLABEngine object.

std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB();
auto matlabApplication = matlab::engine::startMATLAB({u"-desktop"});

Start MATLAB with the -nojvm option and return a unique pointer to the MATLABEngine object.

std::vector<String> optionVec;
optionVec.push_back(u"-nojvm");
std::unique_ptr<MATLABEngine> matlabPtr = startMATLAB(optionVec);

Version History

Introduced in R2017b