Move file into folder
Show older comments
I want to move a created file into created folder. Where is wrong in my code:
for ii=0:10:360
for jj=0:10:90
%%%create a multiple folder
newdir=sprintf('view%2d',ii,jj);
mkdir(fullfile(newdir));
%rotate masks
for i=1:360
rotate(aa,[0,0,1],1);
% print figure with rotate
eval(['print -dpng Slice_' num2str(i) '.png']);
%move figure into folder
movefile('Slice_(i),view%2d',ii,jj')
% pause time
pause(2);
end
end
end
Accepted Answer
More Answers (2)
michio
on 31 Aug 2016
How's trying
filename = ['Slice_',num2str(i),'.png'];
movefile(filename,newdir);
instead of
movefile('Slice_(i),view%2d',ii,jj')
Use the functional syntax of print to print directly to the dir
print('-dpng', fullfile(newdir, ['Slice_' num2str(i) '.png']))
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!