can i determine whether a matlab engine is already running
Ältere Kommentare anzeigen
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.
Antworten (2)
Jeremy Rutman
am 27 Sep. 2015
Bo Li
am 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.
Kategorien
Mehr zu Call MATLAB from Python finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!