matlab::engine::connectMATLAB - Connect to shared MATLAB session synchronously - MATLAB (original) (raw)

Main Content

Connect to shared MATLAB session synchronously

Description

std::unique_ptr<MATLABEngine> connectMATLAB()

std::unique_ptr<MATLABEngine> connectMATLAB(const matlab::engine::String& name)

Connect synchronously to a shared MATLABĀ® session on the local machine.

Include

Namespace: matlab::engine
Include MatlabEngine.hpp

Parameters

const matlab::engine::String& name Name of the shared MATLAB session

Return Value

std::unique_ptr Pointer to a MATLABEngine object

Exceptions

matlab::engine::EngineException Throws exception if function fails to connect to the specified MATLAB session.

Examples

expand all

Connect to a shared MATLAB session named my_matlab.

std::unique_ptr<MATLABEngine> matlabPtr = connectMATLAB(u"my_matlab");

Version History

Introduced in R2017b