I am able to open the saved figure the first time, but I get an error on the second try.
Using OPENFIG,
hf = figure;surf(peaks);drawnowhgsave(hf,'test1-bad.fig');close(hf)hf=openfig('test1-bad.fig')close(hf)hf=openfig('test1-bad.fig') I get the following error:
??? Error using ==> subsref Invalid field name component. Error in ==> D:\Applications\MATLABR12p1\toolbox\matlab\graphics\getappdata.m On line 27 ==> value = subsref(value,struct('type','.','subs',name)); Error in ==> D:\Applications\MATLABR12p1\toolbox\matlab\graphics\openfig.m On line 50 ==> figs = getappdata(0, TOKEN);
Using OPEN,
hf = figure;surf(peaks);drawnowhgsave(hf,'test2-bad.fig');close(hf)hf=open('test2-bad.fig')close(hf)hf=open('test1-bad.fig') I get the following error:
??? Error using ==> open Invalid field name component.
Best Answer