read_path=uigetdir(cd,'Pls choose a folder');
for i=0:num
path=strcat(read_path,int2str(i),'.bmp');
m=imread(path);
% image process
str=strcat('save_path',int2str(i),'.bmp');
imwrite(image,str,'bmp');
end
There are 'num' images in the opening folder, after processing, we save them in folder path 'save_path'.