From 38d293b86447df34da09e74875459eef8537620b Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 17 Aug 2015 08:57:07 +0200 Subject: [PATCH] Replace globals in disp_th_moments.m by function arguments --- matlab/cli/prior.m | 2 +- matlab/disp_th_moments.m | 6 ++---- matlab/stoch_simul.m | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/matlab/cli/prior.m b/matlab/cli/prior.m index d00e0555b..9a4ead849 100644 --- a/matlab/cli/prior.m +++ b/matlab/cli/prior.m @@ -106,7 +106,7 @@ if ismember('moments', varargin) % Prior simulations (2nd order moments). % Solve model [dr,info, M_ ,options_ , oo_] = resol(0, M_ , options_ ,oo_); % Compute and display second order moments - disp_th_moments(oo_.dr,[]); + oo_=disp_th_moments(oo_.dr,[],M_,options_,oo_); skipline(2) donesomething = true; end diff --git a/matlab/disp_th_moments.m b/matlab/disp_th_moments.m index 2b7cec250..c8bd07b35 100644 --- a/matlab/disp_th_moments.m +++ b/matlab/disp_th_moments.m @@ -1,7 +1,7 @@ -function disp_th_moments(dr,var_list) +function oo_=disp_th_moments(dr,var_list,M_,options_,oo_) % Display theoretical moments of variables -% Copyright (C) 2001-2013 Dynare Team +% Copyright (C) 2001-2015 Dynare Team % % This file is part of Dynare. % @@ -18,8 +18,6 @@ function disp_th_moments(dr,var_list) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -global M_ oo_ options_ - nodecomposition = options_.nodecomposition; if size(var_list,1) == 0 diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index 5f51a33e7..6dd07ecc8 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -157,7 +157,7 @@ if options_.nomoments == 0 elseif options_.periods == 0 % There is no code for theoretical moments at 3rd order if options_.order <= 2 - disp_th_moments(oo_.dr,var_list); + oo_=disp_th_moments(oo_.dr,var_list,M_,options_,oo_); end else oo_=disp_moments(oo_.endo_simul,var_list,M_,options_,oo_);