d= dir('*.jpg') for q=1:length(d) disp(q) fn = d(q).name; inf=imfinfo(fn,'jpg'); w=inf.Width; h=inf.Height; i=imread(fn,'jpg'); figure; image(i) axis off p = get(gcf,'Position'); set(gcf,'Position',[p(1) p(2) w h]); title(strrep(fn,'_','-')) print -dpsc -r300 close gcf end