How can I connect to an instance of MATLAB that is already running?
12 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Jan 2021
Answered: MathWorks Support Team
on 20 Jan 2021
I would like to connect to an instance of MATLAB that is already running.
Accepted Answer
MathWorks Support Team
on 20 Jan 2021
If an session of MATLAB has already been opened, you can use the MATLAB function "enableservice"
to MATLAB as an Automation Server. This can be recognized by the "actxGetRunningServer" command in other instances of MATLAB. To enable an instance as an Automation Server, you can execute the following command at the MATLAB Command Prompt:
state = enableservice('AutomationServer', true)
The "actxGetRunningServer" can be used as follows:
h = actxGetRunningServer('matlab.application')
This will allow you to connect to the already existing session of MATLAB.
0 Comments
More Answers (0)
See Also
Categories
Find more on Write COM Applications to Work with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!