saving all figures as jpeg file on harddrive

2 vues (au cours des 30 derniers jours)
AA
AA le 23 Avr 2018
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?

Réponse acceptée

Benjamin Großmann
Benjamin Großmann le 23 Avr 2018
Modifié(e) : Benjamin Großmann le 23 Avr 2018
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)

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by