MATLAB: How to keep Matlab from stealing focus

focusMATLABstealing

I do a lot long running scripts that plot to multiple figure. While these scripts are running, I am unable to use my computer because Matlab steals focus so I can't do anything else while the script is running. It there a way to keep the plot function from stealing focus?

Best Answer

You can set the Visible property of figure handles as 'off'. It will prevent them from stealing focus.
f = figure('Visible', 'off');
at the end, when you want to see it
f.Visible = 'on'; % or set(f, 'Visible', 'on');