MATLAB Answers

Error using cd, Cannot CD

조회 수: 24(최근 30일)
Peiyao Zhao
Peiyao Zhao 12 Jul 2020 20:40
답변: the cyclist 12 Jul 2020 21:29
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

Sign in to comment.

채택된 답변

the cyclist
the cyclist 12 Jul 2020 21:29
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

Sign in to comment.

추가 답변(0개)


Translated by