MATLAB Answers

Is it possible to call from Matlab (with py) a Python code that itself call a Matlab function through matlab.engine ?

Thierry Mazoyer 님이 질문을 제출함. 12 Sep 2019
최근 활동 Gaurav Garg 님이 답변함. 16 Sep 2019
Hi evrybody
Everything's in the title so far !
I have a Python program using Matlab scripts through matlab module. Everything's fine when running directly from Python.
Then I try to use it from Matlab with py but I get the following error: "Python Error: ModuleNotFoundError: No module named 'matlab.engine'; 'matlab' is not a package"
Digging into mixing Matlab and Python since a short time, I've been discovering how powerfull are the offered functionalities... Would be great to be able to push further!
Any possibility to do that ?
Thanks in advance

  댓글 수: 0

로그인 to comment.




답변 수: 1

Gaurav Garg 님의 답변 16 Sep 2019

In my understanding, what you are trying to do is to execute a python code file in a MATLAB script. However, MATLAB provides support for selected functions/data types.
A possible workaround to the problem is to include the statements in a module and then try the steps defined in the link, or, you could also run an operating system command (system) and return the output.

  댓글 수: 0

로그인 to comment.

Translated by