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 Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!