From de630ce9cd62ddae9d9b1872ba1a10bc6af182d6 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Sun, 9 Mar 2025 19:38:30 +0100
Subject: [PATCH] :bug: discretionary_policy: fix noprint option

Output argument and return statement were missing
---
 matlab/discretionary_policy/discretionary_policy.m   | 3 +++
 matlab/discretionary_policy/discretionary_policy_1.m | 1 +
 2 files changed, 4 insertions(+)

diff --git a/matlab/discretionary_policy/discretionary_policy.m b/matlab/discretionary_policy/discretionary_policy.m
index 3c57a91460..f1c982456c 100644
--- a/matlab/discretionary_policy/discretionary_policy.m
+++ b/matlab/discretionary_policy/discretionary_policy.m
@@ -35,6 +35,9 @@ origorder = options_.order;
 options_.order = 1;
 [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list);
 
+if info(1)
+    return;
+end
 oo_.steady_state = oo_.dr.ys;
 
 if ~options_.noprint
diff --git a/matlab/discretionary_policy/discretionary_policy_1.m b/matlab/discretionary_policy/discretionary_policy_1.m
index ec1be205bf..29ef204e79 100644
--- a/matlab/discretionary_policy/discretionary_policy_1.m
+++ b/matlab/discretionary_policy/discretionary_policy_1.m
@@ -42,6 +42,7 @@ if options_.steadystate_flag
     [ys,M_.params,info] = evaluate_steady_state_file(endo_steady_state,[exo_steady_state; exo_det_steady_state],M_, ...
                                                     options_,~options_.steadystate.nocheck);
     if info(1)
+        params=M_.params;
         return;
     end
 else
-- 
GitLab