Running MatLab in Python error
조회 수: 1 (최근 30일)
이전 댓글 표시
Running the following code in Python (Spyder):
import matlab.engine
eng = matlab.engine.start_matlab()
eng.addpath(r'/Users/username/Desktop/spiray_array_model/matlab',nargout=0)
gives me this error:
Warning: Name is nonexistent or not a directory
I can confirm that '/Users/username/Desktop/spiray_array_model/matlab' is indeed a directory.
Is this because I am running from an IDE (Spyder) ? Or am I missing something else?
댓글 수: 0
답변 (1개)
Jesus Sanchez
2019년 11월 28일
Have you tried to delete that "r" that is just before your path?
댓글 수: 3
Jesus Sanchez
2019년 11월 30일
Then the only reason that I can think of is that something is missing. Try to write the full path, including 'C: ...' or whichever directory your folder is into.
참고 항목
카테고리
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!