saving all figures as jpeg file on harddrive
1 次查看(过去 30 天)
显示 更早的评论
Hi, i got a loop and it creates many figures (figure 1, figure 2 and so on). I want to save all as jpeg file on my harddrive. Any ideas?
0 个评论
采纳的回答
Benjamin Großmann
2018-4-23
编辑:Benjamin Großmann
2018-4-23
Collect all the figure handles in a figure handle array, e.g. f(ii) = figure; and then work with arrayfun on the saveas command.
MWE:
clearvars, close all, clc
for ii = 1:10
f(ii) = figure('name',sprintf('fig_%.2d',ii));
plot(rand(5,1),rand(5,1))
end
arrayfun(@(x) saveas(x,x.Name,'jpeg'),f)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!