How to create new folder for each iteraton

For each iteration i need to create new folder and save the image in that folder

 Accepted Answer

an example:
for k=1:5 %for k=1,2,3,4,5
name=['folder' num2str(k)];%new folder name
mkdir(name)%create new folder
imwrite(rand(50,50),fullfile(name,'image.jpg'))%write random image
end

2 Comments

imwrite(rand(50,50),fullfile(name,'image.jpg')) is only vaild for rand.
If we need to create a plot and save then what we can do?

Sign in to comment.

More Answers (3)

how to make a frame from video and every frame should be save in frame folder
extracting frame from video in matlab
Hi
How do I get spectrogram for 1000 .wav files and how to store the results for analysis??

Categories

Find more on Images in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!