matlab 复制图片到另一个文件夹 并且重命名

来源:互联网 发布:用淘宝充话费多久到账 编辑:程序博客网 时间:2024/06/15 18:17
function rename_ETH_picture_output()% rename the pictures in seq01/2/3-img-left to output file.%change the name 'image_00000001_0.png' to '1_image_00000001_0.png'outpath = 'C:\Users\hp\Desktop\DATA\data\ETH\output\';mkdir(outpath);a = 1:1:3;num = length(a); disp('Begin to rename..')for i = 1:num oringalPath = ['C:\Users\hp\Desktop\DATA\data\ETH\seq0',num2str(a(i)),'-img-left']; str = dir(oringalPath);  for j = 3:numel(str)    strline = str(j).name;    Name = [num2str(a(i)),'_',strline];    out = [outpath,Name];    disp(out)      copyfile([oringalPath,'\',str(j).name],out); end enddisp('end~~~')end


0 0