用matlab批量新建和删除文件夹

clear  
clc  

cd('E:\MyData2\test');%设置当前目录:current directory   

for i = 1 : 100  
    folderName{i} = ['movie', num2str(i)];  
    mkdir(folderName{i});  % 新建一个文件夹   
end  
clear  
clc  

cd('E:\MyData2\test'); %设置当前目录:current directory   
for i = 1 : 100  
    rmdir(['movie', num2str(i)]);  % 删除文件夹(不经过回收站)  
end  

关于截取和重新写入···

for i=1:500
        I0=['F:\手掌静脉图像\data_rotate_small_resize\data_rotate_2.4_resize\',sprintf('%d',i),'_6','.bmp'];
        I1=['F:\手掌静脉图像\data_rotate_small_resize\data_rotate_2.4_resize\',sprintf('%d',i),'_12','.bmp'];
        II0=imread(I0);%读取原图像
        II1=imread(I1);
        WTR='E:\MyData2\test\';
        WTR6=strcat(WTR,num2str(i),'\',num2str(i),'_','6(2.4).bmp');
        WTR12=strcat(WTR,num2str(i),'\',num2str(i),'_','12(2.4).bmp');
        imwrite(II0,WTR6);
        imwrite(II1,WTR12);
end

你可能感兴趣的:(matlab)