MATLAB Answers

make a subsubfolder in a newly made subfolder

3 ビュー (過去 30 日間)
sesilia maidelin
sesilia maidelin 2021 年 7 月 16 日
コメント済み: sesilia maidelin 2021 年 7 月 16 日
so i have this code that i use to make a new folder in the path nufolder. its name is based on the contents of dcmlist. now, i want to make a new folder inside this newly made subfolder, so eg in nufolder there's a folder 0002, i want to make another folder inside 0002 that is edn. how do i go about this? i tried using mkdir(name, edn but it didnt work, i also tried mkdir /user.../name edn but it didnt work either. Appreciate any help!
for jj = 1 : numel(dcmlist)
[filepath, name, ext]= fileparts(dcmlist(jj)); % Extract file name
mkdir(nufolderpath, name);% makes folders after the dcm names in nufolder
copyfile(fullfile(dcmpath{jj},dcmlist{jj}),fullfile( nufolderpath, name))
%[status, message, messageId]= copyfile(fullfile(dcmpath{jj},dcmlist{jj})), (fullfile(nufolderpath,name,'/'))% Copy file directly and so string comparison is needed


Jan 2021 年 7 月 16 日
[filepath, name, ext]= fileparts(dcmlist{jj}); % Extract file name
mkdir(fullfile(nufolderpath, name, 'edn'));
  1 件のコメント
sesilia maidelin
sesilia maidelin 2021 年 7 月 16 日
thank you so much!


その他の回答 (0 件)




Community Treasure Hunt

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

Start Hunting!

Translated by