新手入门,求大侠程序:matlab保存多张图片?

2024-11-27 01:15:56
推荐回答(2个)
回答1:

for i=1:10

url= strcat('C:\picture\',num2str(i),'.bmp');

imwrite(I,url);

end;

大概结构就是这样的,每次i变化,写入和读取的地址就会变化,这个网上很多,搜一下就有了

回答2:

path0 = 'C:\picture\';
for J = 1:10
path = [path0 num2str(J) '\'];
for f = 1:10
fnm = [path num2str(f) '.jpg'];
I = imread(fnm);
g = rgb2gray(I);
imwrite(g,fnm);
end;
end;