can i determine whether a matlab engine is already running
Show older comments
I would like to avoid restarting the matlab engine every time I need a matlab calculation. Is there a way to determine whether an engine is already running? I currently start a new engine every time using
#python
eng = matlab.engine.start_matlab()
I have tried storing the eng object in a redis key-value store but the object reference seems to get converted to a string.
Answers (2)
Jeremy Rutman
on 27 Sep 2015
Bo Li
on 28 Sep 2015
What do you mean by "eng.shareEngine runs but does not seems to create a shared engine"?
Typically, you would launch a MATLAB and convert it into a shared session:
%MATLAB code
>>matlab.engine.shareEngine
After that, you can connect to this shared MATLAB from a Python session:
>>>engs=matlab.engine.find_matlab()
>>>eng=matlab.engine.connect_matlab(engs[0])
Not sure about the redis issue, but it should be applicable to other Python objects.
Categories
Find more on Call MATLAB from Python in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!