You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
396 B
Matlab

function figured(figNum)
%Alternative to the "figure" command that does not grab focus unless the figure window needs to be created
figHandles = findobj('Type','figure');
if sum(figNum==figHandles)<0.5
%new figure number, so create
figure(figNum);
else
%existing figure number, so use without giving that figure focus
drawnow; %but empty buffer first
set(0,'CurrentFigure',figNum);
end