How to save a GUI figure in matlab
조회 수: 55 (최근 30일)
이전 댓글 표시
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')
Fig- 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
Rik
2019년 6월 24일
Since the menu is generally disabled in a GUI, that option is probably not available.
참고 항목
카테고리
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!