Not able to cd into a folder
조회 수: 2 (최근 30일)
Anay Aggarwal 2022년 7월 13일
I have an understanding that you want to create a folder and then cd into it while runtime.
Following might help:
mkdir("dB_"+name); % create a folder
cd ([ 'dB_' convertContainedStringsToChars(name) ]);
This would create a folder and cd into it while runtime.
추가 답변 (1개)
Voss 2022년 7월 13일
Maybe check that mkdir successfully creates the directory:
status = mkdir("dB_"+name)
Here status is true, so we know the directory was created.
Then cd into it:
cd() % show the current working directory
If mkdir returns false, it means mkdir was not able to create the directory, maybe because you don't have write permissions in the parent directory (i.e., the directory you're in when you call mkdir).