From 8e5fd8dc4ee9576eddbfcb9fcd40e52c137bdb9c Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Thu, 21 Nov 2019 11:58:16 +0100 Subject: [PATCH] Move creation of subfolder outside of TeX-check Required if we only want the figure --- matlab/dynare_estimation_1.m | 6 +++--- matlab/mode_check.m | 6 +++--- matlab/plot_priors.m | 6 +++--- matlab/stoch_simul.m | 5 +++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index c1710420a1..d87764dd6c 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -556,10 +556,10 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha if ~options_.nograph [nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr); + if ~exist([M_.fname '/graphs'],'dir') + mkdir(M_.fname,'graphs'); + end if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) - if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); - end fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_SmoothedShocks.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'); fprintf(fidTeX,['%% ' datestr(now,0) '\n']); diff --git a/matlab/mode_check.m b/matlab/mode_check.m index 1389d1737d..e061af3a2b 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -77,10 +77,10 @@ end [nbplt,nr,nc,lr,lc,nstar] = pltorg(length(x)); +if ~exist([Model.fname filesep 'graphs'],'dir') + mkdir(Model.fname,'graphs'); +end if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format))) - if ~exist([Model.fname filesep 'graphs'],'dir') - mkdir(Model.fname,'graphs'); - end fidTeX = fopen([Model.fname, '/graphs/', Model.fname '_CheckPlots.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by mode_check.m (Dynare).\n'); fprintf(fidTeX,['%% ' datestr(now,0) '\n']); diff --git a/matlab/plot_priors.m b/matlab/plot_priors.m index 0a70a6b919..cbe288d2ca 100644 --- a/matlab/plot_priors.m +++ b/matlab/plot_priors.m @@ -36,10 +36,10 @@ figurename = 'Priors'; npar = length(bayestopt_.p1); [nbplt,nr,nc,lr,lc,nstar] = pltorg(npar); +if ~exist([M_.fname '/graphs'],'dir') + mkdir(M_.fname,'graphs'); +end if TeX && any(strcmp('eps',cellstr(options_.graph_format))) - if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); - end fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_Priors.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n'); fprintf(fidTeX,['%% ' datestr(now,0) '\n']); diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index bcfbadd116..43e5c068ca 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -201,11 +201,12 @@ end if options_.irf var_listTeX = M_.endo_names_tex(i_var); - - if TeX && any(strcmp('eps',cellstr(options_.graph_format))) + if ~options_.nograph if ~exist([M_.fname '/graphs'],'dir') mkdir(M_.fname,'graphs'); end + end + if TeX && any(strcmp('eps',cellstr(options_.graph_format))) fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_IRF.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by stoch_simul.m (Dynare).\n'); fprintf(fidTeX,['%% ' datestr(now,0) '\n']); -- GitLab