creating folders in matlab

How can I create folders by name 1,2,3,4 in a directory

Answers (1)

targetdirectory = 'ThePlaceToPutThem';
for K = 1 : 4
foldername = fullfile(targetdirectory, sprintf('%d', K));
mkdir(foldername);
end

Categories

Asked:

on 22 Jan 2016

Answered:

on 22 Jan 2016

Community Treasure Hunt

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

Start Hunting!