% WARNING: call_cleanup.m deletes all generated output files from the working
% directory, including .eps, .pdf, .tex, .log, and related files, as well as
% all Dynare-generated files and +model_* and model_* folders. This action is
% irreversible. readme.tex and readme.pdf are preserved. Run only to start
% fresh. It will erase all figures and tables produced by the replication scripts.



delete *.eps
delete *.asv
delete *.dvi
delete *.aux

delete *_static.m
delete *_results.mat
delete *_dynamic.m
delete *_set_auxiliary_variables.m
delete *.log
delete *.*latexmk
delete *.fls
delete *.gz
!rm -r +LQBBCDL*

% Delete plain model_* directories created by Dynare at parse time.
% Filter to directories only so that .mod source files are never at risk.
model_dirs = dir('LQBBCDL*');
model_dirs = model_dirs([model_dirs.isdir]);
for i = 1:length(model_dirs)
    rmdir(model_dirs(i).name, 's');
end