MATLAB: Is there a delay in outputting values when I resize the figure, which has a “ResizeFcn” set to output data to the workspace, in MATLAB 7.0.4 (R14SP2)

basefunctionMATLABoutputtingprintingresizeworkspace

I create a figure with a "ResizeFcn" property value:
figure;
set(gcf,'ResizeFcn','tic;pos=get(gcf,''Position''),toc');
Then I resize the window and wait for the position and the execution time to be output. The results do not appear for about 4 seconds.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for possible workarounds.
There is a bug in MATLAB 7.0.4 (R14SP2) in the way that the Resize Function handles printing to the workspace.
To work around this issue, you can save the information you want to print to a variable and print out that variable later. For example:
figure;set(gcf,'ResizeFcn','tic;pos=get(gcf,''Position'');,t=toc;');
t, pos