Content of uiFigure lost when using savefig()

Hello there,
lately I have been working with uifigures in the following setting:
I run some experiments with a Matlab script which produces a lot of figures. Therefore, I created a uifigure with some Tab-Groups where I can present my experiment results in a nice way (see the picture below).
These experiments take a long time to run through so I don't want to run it every time anew but I would like to be able to save the uiFigure once it is presented as depicted. I tried some of the following code to do that
savefig(fig,'UI_Results.fig')
saveas(fig,'saved_figure_fig','fig')
saveas(fig,'saved_figure_m','m')
saveas(fig,'saved_figure_mfig','mfig')
saveas(fig,'saved_figure_mmat','mmat')
hgsave(fig, 'saved_figure_hgsave')
function fig = make_ui()
% this function produces my uiFigure
fig = uifigure;
% Here is some code:
% ...
end
However, loading the saved figure is disappointing as all the content seems to be lost (see the picture below).
Did I miss something when saving the figure or is there no such way to save the figure for later use?
Any help is very much appreciated,
Daniel
Here is my implementation:
  • A Matlab sctipt 'run_experiments.m'
  • A Matlab class 'simulation_results.m'

 採用された回答

Jason
Jason 2022 年 7 月 21 日
編集済み: Jason 2022 年 7 月 21 日

1 投票

Hi Daniel. I dont have a solution but I have run into a similar issue where I have a uigridlayout on a uifigure and it doesn't open properly. I have contacted Matlab support and they have indicated its a bug and are currently looking into it

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Programmatically についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 5 月 25 日

編集済み:

2022 年 7 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by