diff --git a/matlab/sim1_purely_backward.m b/matlab/sim1_purely_backward.m index 14cd5a290..10479372d 100644 --- a/matlab/sim1_purely_backward.m +++ b/matlab/sim1_purely_backward.m @@ -34,6 +34,7 @@ function sim1_purely_backward yb = oo_.endo_simul(:,it-1); % Values at previous period, also used as guess value for current period yb1 = yb(iyb); - oo_.endo_simul(:,it) = solve1(model_dynamic, [yb1; yb], 1:M_.endo_nbr, nyb+1:nyb+M_.endo_nbr, 1, 1, oo_.exo_simul, M_.params, oo_.steady_state, it)(nyb+1:nyb+M_.endo_nbr); + tmp = solve1(model_dynamic, [yb1; yb], 1:M_.endo_nbr, nyb+1:nyb+M_.endo_nbr, 1, 1, oo_.exo_simul, M_.params, oo_.steady_state, it); + oo_.endo_simul(:,it) = tmp(nyb+1:nyb+M_.endo_nbr); end \ No newline at end of file diff --git a/matlab/sim1_purely_forward.m b/matlab/sim1_purely_forward.m index 17b3f3b9c..1ec31f2cb 100644 --- a/matlab/sim1_purely_forward.m +++ b/matlab/sim1_purely_forward.m @@ -33,6 +33,7 @@ function sim1_purely_forward yf = oo_.endo_simul(:,it+1); % Values at next period, also used as guess value for current period yf1 = yf(iyf); - oo_.endo_simul(:,it) = solve1(model_dynamic, [yf; yf1], 1:M_.endo_nbr, 1:M_.endo_nbr, 1, 1, oo_.exo_simul, M_.params, oo_.steady_state, it)(1:M_.endo_nbr); + tmp = solve1(model_dynamic, [yf; yf1], 1:M_.endo_nbr, 1:M_.endo_nbr, 1, 1, oo_.exo_simul, M_.params, oo_.steady_state, it); + oo_.endo_simul(:,it) = tmp(1:M_.endo_nbr); end \ No newline at end of file