matlab.engine.shareEngine

Convert running MATLAB session to shared session

Syntax

  • matlab.engine.shareEngine
    example
  • matlab.engine.shareEngine(name)
    example

Description

example

matlab.engine.shareEngine converts the current MATLAB® session to a shared session with a default name. The default name is 'MATLAB_<process_ID>', where <process_ID> is a number that indicates the process ID of the current MATLAB session.

example

matlab.engine.shareEngine(name) converts the current MATLAB session to a shared session and gives it the name specified by name.

If there is already a shared MATLAB session on your local machine that has the name specified by name, then matlab.engine.shareEngine converts the current session to a shared session with a default name.

Examples

collapse all

Convert the current MATLAB session to a shared session with a default name.

matlab.engine.shareEngine
matlab.engine.engineName
ans =

MATLAB_49593

matlab.engine.shareEngine gives the shared session the default name MATLAB_49593, where 49593 is the process ID of the MATLAB session. The process ID is different each time you start MATLAB.

Give a name to the current MATLAB session and share the session.

matlab.engine.shareEngine('Engine_1')
matlab.engine.engineName
ans =

Engine_1

Related Examples

Input Arguments

collapse all

Name of the shared MATLAB session, specified as a character array. name must be a valid MATLAB variable name.

More About

collapse all

Tips

You also can use a MATLAB startup option to start a shared session. To start a shared MATLAB session, type this command at the operating system prompt:

matlab -r 'matlab.engine.shareEngine'

Introduced in R2015b

Was this topic helpful?