MATLAB: Can not open fig files saved by “saveas” after live script ran

live-script fig-filesMATLAB

Hi, everyone. I encountered a problem in Matlab2019b these days.
I want to save the .fig files and .eps files after the live script done with
saveas(gcf,'path/fig_name','fig')
print(gcf,'path/fig_name','-r300','-depsc')
Everyting is fine with those .eps files. However, those fig files were also saved but I just can't open them.
If I select the plotting commands, press F9 run them again, replot the figures in private windows as .m script do, then those saved fig files can be opened with matlab.
Any advice will be appreciated.
Thx!

Best Answer

fig = openfig('1t6e7_85Hfluxc17.fig');
fig.Visible = 'on';
That is, that your figures are being created, but their visibility is set to off.