MATLAB: Update figure in background without stealing focus

backgroundfigurefocusMATLABupdate

I have a MATLAB script that periodically loads data output from a external model simulation of fluid flow, and then plots (or re-plots) it. When data are plotted, the figure window becomes the active window and is brought to the front of the screen, stealing the focus from any other window (emacs, word, etc).
I would like the matlab figure to simply update in the background so I can visually track model progress while working on other things.
Thanks!

Best Answer

How are you updating the figure? For example this little function with a timer that updates a plot doesn't steal focus from me.
function example_focusin
T = timer('timerfcn',@updatePlot,'period',5,'executionmode','fixedrate','taskstoexecute',10);
figure;
h = plot(rand(1,10));
start(T);
function updatePlot(src,evt)
set(h,'ydata',rand(1,10));
end
end