App designer : Saveas save all the interface and not just the figure mentionned
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I made an interface with add designer where I display different graphs. I would like to save these graphs separately.
So I used saveas(app.Power_loss,fullfile(fname,'Simulation of PEMFC'),'fig'); where app.Power_loss is the name of UIAxes.
The first problem is that I can't use the png format but only the fig format.
The second is that it saves the entire interface. Moreover, it only takes into account the graphs comprising a single curve. I can't understand why the saveas command behaves like this. Do you have an idea?
0 个评论
回答(1 个)
Saurabh
2024-2-16
Hi Bastien,
So, what I have understood from your question is that you want to save the graphs of your app separately, and you are using saveas function to achieve this, but the results you got are not what you were looking for.
I have tried to reproduce the issue on my side, and I too faced a similar issue.
So, I did some research on what the possible workaround for this issue could be and found out that there is another function named exportgraphics that can do the required thing.
The syntax for using this function is:
exportgraphics(app.Uifigurename, filename.png);
You need to replace the Uifigurename with the figure you want to save, and filename is the name of the file you want to give.
For more information about this function, you can refer to: https://www.mathworks.com/help/matlab/creating_plots/saving-your-work.html
I hope this was helpful!
Regards,
Saurabh Singh
0 个评论
另请参阅
类别
在 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!