how can i fix the "error using cd"?
조회 수: 14 (최근 30일)
이전 댓글 표시
This is the error
" Error using cd
Cannot CD to /Users/aounqureshi/Master/PV PARAMETERS 2/Data\ (Name is nonexistent or not a directory).
Error in RundatapreprocessingButtonUJA (line 35)
cd(ExportPath); "
how can i fix this error of my GUI app in matlab ?
댓글 수: 5
Rik
2021년 6월 8일
We are asking about your code. Your error suggests you are hardcoding something you should be doing differently.
답변 (2개)
Steven Lord
2021년 6월 8일
Did you use fullfile to assemble the ExportPath variable, did you manually concatenate pieces together with slashes inbetween, or did you type the whole path out manually? I would probably use fullfile as it would put the right separators between parts of the file path.
That trailing \ looks suspicious as well.
Walter Roberson
2021년 6월 8일
편집: Walter Roberson
2021년 6월 8일
You need to take the code and convert all \ directory separators in the code into / directory separators, except for some cases involving using system() . [If your code uses dos() or .NET facilities, that part needs to be rewritten anyhow.]
Or you could rewrite the code so that you never explicitly use \ or / as the directory separator at all, and instead use fullfile()
Note that using / to seperate directories is fine in MS Windows, except for use in COMMAND.COM or CMD.EXE or PowerShell . MS Windows uses / internally, not \ -- it is only the command line processing that needs \
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Package MATLAB Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!