![output.bmp](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226399/output.bmp)
How to save a GUI figure in matlab
49 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226067/image.gif)
Like this picture I wanted to save my GUI figure. But I dont know how to do that
0 个评论
回答(3 个)
Murugan C
2019-6-26
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.bmp](https://www.mathworks.com/matlabcentral/answers/uploaded_files/226399/output.bmp)
1 个评论
Robert
2019-12-2
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
Himanshu Rai
2019-6-24
编辑:Himanshu Rai
2019-6-24
Have you tried export_fig() - https://in.mathworks.com/matlabcentral/fileexchange/23629-export_fig
0 个评论
Yash Totla
2019-6-24
% ...
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 个评论
另请参阅
类别
在 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!