I would like to create a subfolder without numbering

I would like to create a subfolder without numbering. I tried this code:
GLOBAL2 = 'C:\Users\Alberto\Desktop\GLOBAL2';
for K = 1
folder_DATA = fullfile(GLOBAL2, sprintf('DATA %d', K));
name_SF = 'newSubfolder';
new_folder = fullfile(folder_DATA, sprintf('%s%d', name_SF, 1)); % i would like to create a 'newSubfolder' subfolder (and not 'newSubfolder1')
end
How can I change it?
I had thought about mkdir but could not apply it to the desired folder.
mkdir parentFolder folderName

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2022년 11월 8일
편집: KALYAN ACHARJYA 2022년 11월 8일
Just remove %d
new_folder = fullfile(folder_DATA, sprintf('%s', name_SF));
If you're generating a single folder, that's fine, but to create the folders within the loop, you should put the names sequentially, which can help to differentiate.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 11월 8일

편집:

2022년 11월 8일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by