saving all figures as jpeg file on harddrive

조회 수: 2 (최근 30일)
AA
AA 2018년 4월 23일
편집: Benjamin Großmann 2018년 4월 23일
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?

채택된 답변

Benjamin Großmann
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개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by