The ability to create figures in background is not available in MATLAB 7.8 (R2009a).
To workaround this issue, use any of the following workarounds:
1. Create the figure with 'Visible' property to be 'off' and save the figure. While loading the figure change this property to 'on'. For instance:
h=figure('Visible','off');
plot(1:10)
hgsave(h,'firstfigure.fig');
close(h)
prop.Visible='on';
[h1,old_prop]=hgload('firstfigure.fig',prop);
2. Create the figure with 'Visible' property to be 'off' and save the figure. Then set the figure's 'CreateFcn' to set the 'Visible' property back to 'on'. This will only get implemented next time the same figure is created and will have no effect on the current figure as it is already created. For instance:
h = figure('Visible','off');
set(h,'CreateFcn','set(h,''Visible'',''on'')');
plot(1:10);
hgsave(h,'secondfigure.fig');
close(h);
hgload('secondfigure.fig');
Best Answer