restorefig.m (661B)
1 function restorefig(h,old) 2 %RESTOREFIG Restore a figure's properties 3 % RESTOREFIG(H,OLD) restores the properties of H specified in 4 % OLD. The state-difference structure OLD is the output of the 5 % function APPLYTOFIG. Deleting object handles after the call to 6 % APPLYFIG might cause undesired behavior. 7 % 8 % See also EXPORTFIG, PREVIEWFIG, APPLYTOFIG. 9 10 % Copyright 2000 Ben Hinkle 11 % Email bug reports and comments to bhinkle@mathworks.com 12 13 for n=1:length(old.objs) 14 try 15 if ~iscell(old.values{n}) & iscell(old.prop{n}) 16 old.values{n} = {old.values{n}}; 17 end 18 set(old.objs{n}, old.prop{n}, old.values{n}); 19 end 20 end