%Copyright (c) 2010, Luuk J.G.W. van Wilderen
%
%close_figs.m

%Closes all open figures. Selection is based on figure name, so if other
%figures are open, they remain open.

if isempty(findobj('Name','Optimization PlotFcns'))==0
    close ('Optimization PlotFcns');
end
if isempty(findobj('Name','Pattern Search'))==0
    close ('Pattern Search');
end
if isempty(findobj('Name','Loaded_raw_data'))==0
    close Loaded_raw_data;
end
if isempty(findobj('Name','Explore raw data'))==0
    close ('Explore raw data');
end
if isempty(findobj('Name','Dispersion estimation'))==0
    close ('Dispersion estimation');
end
if isempty(findobj('Name','Loaded dispersion curve'))==0
    close ('Loaded dispersion curve');
end
if isempty(findobj('Name','Raw data Concentration profiles'))==0
    close ('Raw data Concentration profiles');
end
if isempty(findobj('Name','trace1'))==0
    close trace1;
end
if isempty(findobj('Name','spectra'))==0
    close spectra;
end
if isempty(findobj('Name','trace2'))==0
    close trace2;
end
if isempty(findobj('Name','trace3'))==0
    close trace3;
end
if isempty(findobj('Name','trace4'))==0
    close trace4;
end
if isempty(findobj('Name','trace5'))==0
    close trace5;
end
if isempty(findobj('Name','trace6'))==0
    close trace6;
end
if isempty(findobj('Name','Explore fit'))==0
    close ('Explore fit');
end
if isempty(findobj('Name','residuals'))==0
    close residuals;
end
if isempty(findobj('Name','Fit_progress'))==0
    close 'Fit_progress';
end
if isempty(findobj('Name','Dispersion correction'))==0
    close ('Dispersion correction');
end