Error using cd, Cannot CD
조회 수: 8 (최근 30일)
이전 댓글 표시
When I tried to run the following code in my matlab, it said" Error using cd, Cannot CD to( Name is nonexistent or not a directory), could you tell me why this happens, thank you very much!
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
댓글 수: 0
채택된 답변
the cyclist
2020년 7월 12일
This code works for me when mfilename is a file that exists in my path, but otherwise it gives that error. So, my guess is that you have an error in what is stored in mfilename.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!