- This page has specific instructions: https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-python.html
- This higher level page has instructions for installation and getting started: https://www.mathworks.com/help/matlab/matlab-engine-for-python.html?s_tid=CRUX_lftnav
How to call matlab from python?
조회 수: 13 (최근 30일)
이전 댓글 표시
채택된 답변
Dave B
2021년 8월 24일
I think you mean you want to call a MATLAB function from Python?
Alternatively, if you want to export results from MATLAB to a file that you can read in Python, there are lots of options for file formats depending on the data. if you have neatly organized matrix data, you might consider using writematrix to make a comma delimited file and csv.py to read it. Or if you have something more complicated, maybe h5write to write make an hdf5 file and h5py to read it.
댓글 수: 2
Dave B
2021년 8월 24일
편집: Dave B
2021년 8월 24일
@M bd Please have a look at the links above, they are describing how to do exactly what you're asking. The first link shows python code to return the output of a MATLAB function, but you'll probably have to work out the setup/installation as described in the second link.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!