Connect shared MATLAB session to MATLAB Engine for Python
eng = matlab.engine.connect_matlab(name=None)
eng = matlab.engine.connect_matlab(___,async)
connects
to the shared MATLAB® session, eng
= matlab.engine.connect_matlab(name
=None)name
, and returns
a MatlabEngine
object as eng
.
The input argument name
specifies the name of a MATLAB session
that is already running on your local machine.
If you specify name
and the engine
cannot find a shared MATLAB session of the same name, then you
receive an EngineError
exception.
If you do not specify name
and
the engine cannot find any shared MATLAB sessions, then it starts
a new shared MATLAB session. If there are shared MATLAB sessions
running, the engine connects to the first available session.
If you do not specify name
and
the engine finds multiple shared MATLAB sessions running, then
it connects to the first available session.
Do not connect the engine multiple times to the same shared MATLAB session.