MATLAB Answers

0

How to save a GUI figure in matlab

Asked by faiza gul on 24 Jun 2019
Latest activity Answered by Murugan C on 26 Jun 2019
Like this picture I wanted to save my GUI figure. But I dont know how to do that

  0 Comments

Sign in to comment.

Tags

3 Answers

Answer by Himanshu Rai on 24 Jun 2019
Edited by Himanshu Rai on 24 Jun 2019

  0 Comments

Sign in to comment.


Answer by Yash Totla on 24 Jun 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 Comment

Rik
on 24 Jun 2019
Since the menu is generally disabled in a GUI, that option is probably not available.

Sign in to comment.


Answer by Murugan C on 26 Jun 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

  0 Comments

Sign in to comment.