Running MatLab in Python error
2 次查看(过去 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!