addpath(cd) returns name is nonexistent or not a directory
이전 댓글 표시
OS: mac OS "Big Sur" v. 11.6
MATLAB: '9.10.0.1739362 (R2021a) Update 5'
If I CD to a directory in my Box folder and type addpath(cd), I get name is non existent or not a directory. How is that possible? I don't have this problem on my other computer running Mojave and Matlab 2020b (I think).
Maybe relevant: I'm running matlab by opening a terminal and executing this:
sudo /applications/Matlab_r2021a.app/bin/matlab
If I just launch matlab by double-clicking the app icon anything relying on Java runs painfully slow... I found somewhere on the help community that running from a terminal instance works around that, which seems to be true.
댓글 수: 2
Adam Snyder
2021년 12월 29일
Adam Danz
2021년 12월 30일
Does the same behavior occur when you CD to a local folder? I'm not a mac user so I cannot test it. There are known problems associated with CD'ing to remote or cloud folders.
채택된 답변
추가 답변 (2개)
Rik
2021년 12월 30일
0 개 추천
What do you expect to happen when you call cd without any input?
It looks like you actually intend to use addpath(pwd).
댓글 수: 3
Stephen23
2021년 12월 30일
"What do you expect to happen when you call cd without any input?"
It returns the current working directory:
out = cd()
You might be interested to look at the content of PWD.
Rik
2021년 12월 30일
Well, I guess you learn something every day. Thank you Stephen and Jan.
I'll leave my answer up for documentary purposes.
Image Analyst
2021년 12월 30일
0 개 추천
The current directory is automatically on the path so perhaps it just throws an error because it does not need to be added via addpath(), though it could probably have chosen a more descriptive error message if that were the case.
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!