Save Figures to One Folder

52 visualizaciones (últimos 30 días)
Amanda
Amanda el 23 de Abr. de 2013
Comentada: Tanziha Mahjabin el 17 de Feb. de 2020
I want to save multiple figures to the same folder, with the name of figure_1, figure_2, etc.
Here is the code: x = 1:5;
y = [1,1,1,1,1]
z = [2,2,2,2,2]
a = [3,3,3,3,3]
b = [4,4,4,4,4]
c = [5,5,5,5,5]
figure;
plot(x,y)
figure;
plot(x,z)
figure;
plot(x,a)
figure;
plot(x,b)
figure;
plot(x,c)

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 23 de Abr. de 2013
figure;
h(1)=plot(x,y)
figure;
h(2)=plot(x,z)
figure;
h(3)=plot(x,a)
figure;
h(4)=plot(x,b)
figure;
h(5)=plot(x,c)
for k=1:5
saveas(h(k),sprintf('figure_%d.jpg',k))
end
  3 comentarios
Mohammad Bhat
Mohammad Bhat el 23 de Feb. de 2018
Undefined function or variable 'export_fig'. Matlab 2016

Iniciar sesión para comentar.

Más respuestas (1)

venkata reddy kopparthi
venkata reddy kopparthi el 12 de Jul. de 2018
Editada: venkata reddy kopparthi el 12 de Jul. de 2018
  • we can save current open figure by saveas library
  • saveas(gcf,'<path>\figure_name.jpg');
  1 comentario
Tanziha Mahjabin
Tanziha Mahjabin el 17 de Feb. de 2020
Hi,
i have already saved figures in a folder. how can i make a gif in matlab combining all of them?

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by