figdirectory = './out/';
destpath = './fin/';
fullpath = sprintf('%s/*.fig',figdirectory)
d = dir(fullpath);
length_d = length(d)
if(length_d == 0)
disp('couldnt read the directory details\n');
disp('check if your files are in correct directory\n');
end
startfig = 1
endfig = length_d
for i = startfig:endfig
fname = d(i).name;
disp(['current file --> ' fname]);
fname_input = sprintf('%s/%s',figdirectory,fname);
fname_output = sprintf('%s/%s',destpath,fname(1:end-4));
hf = openfig(fname_input);
saveas(hf,fname_output,'jpg');
close(hf);
end
fig2jpg matlab
最新推荐文章于 2024-04-10 22:23:20 发布