Make the subfolders name in output folder the same input folder
Mostrar comentarios más antiguos
I have a data process folder like this: with directory ~/Matlab/homework_4/input

I already access into the folder to sub-folder to do my job by the code:
d = dir(pwd);%d(1:2) = [];
isub = [d(:).isdir]; %# returns logical vector
fname = {d(isub).name}';
fname(ismember({d.name}, {'.', '..'})) = []; %remove . and .. of folder name.
% ------------------------------------------------------------
for i = 1:length(fname)
cd(char(fname{i})
<[........ Do the job .......]
output_data.dat>
end
and wanna create the same-name of sub-folder on the directories: "~/Matlab/homework_4/output" using "fname{i}" on the code. And move the output_data.dat to that folder. Any way to do this? Many thanks :(
2 comentarios
awezmm
el 3 de Nov. de 2018
So basically, you want to have a copy of ~/Matlab/homework_4/input but instead, name it ~/Matlab/homework_4/output with all the same subfolders inside?
Long Hà Vinh
el 3 de Nov. de 2018
Respuesta aceptada
Más respuestas (1)
madhan ravi
el 3 de Nov. de 2018
0 votos
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!