Calling Mex File inside a Matlab Engine Call from Python, matlab.engine.EngineError: MATLAB function cannot be evaluated, SystemError: MATLAB process cannot be terminated
显示 更早的评论
I have an imaging pipeline that is in Python, this pipelline needs to call a scripts Matlab doing wavelet filtering. However the Matlab code I have is calling some compiled C code. I know it seems completely absurd but for now I have to go this way.
Is it possible to call a C mex file through Matlab called by python with the Matlab engine?
Thanks.
Here is the full error message I get:
File "/PATH/TO/PYTHON/Script.py", line 93, in <module>
piw_reslice(s['pet'], 6, 1, 24)
File "/PATH/TO/PYTHON/module.py", line 14, in piw_reslice
nargout=0)
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/matlabengine.py", line 71, in __call__
_stderr, feval=True).result()
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/futureresult.py", line 67, in result
return self.__future.result(timeout)
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/fevalfuture.py", line 82, in result
self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.EngineError: MATLAB function cannot be evaluated
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/__init__.py", line 193, in __exit_engines
eng().exit()
File "PATH/TO/envs/pysep3/lib/python3.7/site-packages/matlab/engine/matlabengine.py", line 232, in exit
pythonengine.closeMATLAB(self.__dict__["_matlab"])
SystemError: MATLAB process cannot be terminated.
4 个评论
dylan Lee
2020-7-21
hello, do you solve this problem. i have the same problem, can you please help me.
Arya YAZDAN PANAH
2020-7-21
dylan Lee
2020-7-23
Tharks for your answer。I have slove this problem by sharing this matlab session with python.
晨曦 刘
2020-9-25
I also have this question, can you please tell me how do you share the matlab session with python?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Call MATLAB from Python 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!