How to save a GUI figure in matlab

64 visualizaciones (últimos 30 días)
passioncoding
passioncoding el 24 de Jun. de 2019
Comentada: Robert el 2 de Dic. de 2019
Like this picture I wanted to save my GUI figure. But I dont know how to do that

Respuestas (3)

Murugan C
Murugan C el 26 de Jun. de 2019
we can use the saveas command to save your Figure OR GUI to a specific file format as like below.
If you press Save Fig button in gui, below code gcf will capture your window and save in bmp format into your current directory.
saveas(gcf,'output','bmp')
output.bmpFig- output.bmp
  1 comentario
Robert
Robert el 2 de Dic. de 2019
Hi,
thanks to this example, which solved my problem first. Nevertheless I would like to save a gui window in png or jpg-format, because the size of bmp ist pretty big. If I choose jpg or png, only a small part of the figure is saved. Do you know a solution for this?
Kind regards
Robert

Iniciar sesión para comentar.


Himanshu Rai
Himanshu Rai el 24 de Jun. de 2019
Editada: Himanshu Rai el 24 de Jun. de 2019

Yash Totla
Yash Totla el 24 de Jun. de 2019
You can use the saveas command to save your figure to a specific file format.
% ...
h = figure;
plot(X, y, '-bs', 'Linewidth', 1.4, 'Markersize', 10);
% ...
saveas(h,name,'fig')
saveas(h,name,'jpg')
This way, the figure is plotted, and automatically saved to the desired file format.
Alternatively you can wait for the plot to appear and click 'save as' in the menu.
  1 comentario
Rik
Rik el 24 de Jun. de 2019
Since the menu is generally disabled in a GUI, that option is probably not available.

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by