Matlab批量处理文件

来源:互联网 发布:淘宝旺旺有卖家版吗 编辑:程序博客网 时间:2024/04/29 20:51

原文写于2013年7月10日

cd ('..\img\5');files=dir('*.jpg');m=size(files,1);n = 1;%文件名从n开始for i=n:m+n-1    G=imread(files(i-n+1).name);    if i<10        x = strcat('frame_000',num2str(i));    else if i<100            x = strcat('frame_00',num2str(i));        else            x = strcat('frame_0',num2str(i));        end    end    y = 'jpg';    w = strcat(x,'.',y);    imwrite(G,w);end

以统一格式命名为例

原创粉丝点击