필터 지우기
필터 지우기

App designer : Saveas save all the interface and not just the figure mentionned

조회 수: 3 (최근 30일)
Bastien Binz
Bastien Binz 2021년 7월 1일
답변: Saurabh 2024년 2월 16일
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?

답변 (1개)

Saurabh
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

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by