How to call matlab nested matlab functions from python?
조회 수: 1 (최근 30일)
이전 댓글 표시
Say my folder structure looks like this:
/project/
my_python_script.py
/some_cool_matlab_functions/
myfunction1.m
/some_different_cool_matlab_functions/
myfunction2.m
In my python script I run
import matlab.engine
engine = matlab.engine.start_matlab()
%#this next line fails
engine.some_cool_matlab_functions.myfunction1()
%#this also fails
engine.myfunction1()
How do I from python reference those functions that sit in subfolders? I can't seem to find actual documentation about matlab.engine beyond the examples on the mathworks site. I assume there must be a way to use the matlab.engine class or subclass to declare some kind of workspace etc.
Any help is appreciated.
댓글 수: 0
답변 (1개)
Biral Pradhan
2022년 9월 5일
Kindly check if the project folder is added to MATLAB path. For more information, kindly follow the below link.
댓글 수: 0
참고 항목
카테고리
Help Center 및 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!