Code covered by the BSD License  

Highlights from
MOtion DEcision (MODE) model

image thumbnail
from MOtion DEcision (MODE) model by Massimiliano Versace
MOtion DEcision (MODE) model is a neural model of perceptual decision-making.

rmfigures(varargin)
function rmfigures(varargin)
% function rmfigures(varargin)
% Purpose : Without input argument, it removes all user-generated figures. 
%           With 'all' as input argument, it removes figures and GUIs.
% Usage examples:
% >> rmfigures         % remove only user figures
% >> rmfigures('all')  % remove all figures and GUIs
%
oldStatus = get(0, 'showhiddenhandles');
if nargin == 0
    set(0,'showhiddenhandles', 'off');   % make sure it is off
    delete(findobj('Type', 'Figure'));
else
    set(0, 'showhiddenhandles', 'On');   % Now, GUI handles can be seen
    hf = findobj('Type', 'Figure');
    delete(findobj('Type', 'Figure'));
end
set(0,'showhiddenhandles', oldStatus);   % reset the status

Contact us at files@mathworks.com