From a60ce435bd032a9689efbf89177ce8ba683326ed Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 22 Feb 2022 12:22:51 +0100
Subject: [PATCH] get_error_message.m: condition on index being non-zero

dsge_likelihood will expand the vector due to entry four of info containing the penalty, creating a 0 for entry 2
---
 matlab/get_error_message.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/get_error_message.m b/matlab/get_error_message.m
index 6cab297a62..f59cac2842 100644
--- a/matlab/get_error_message.m
+++ b/matlab/get_error_message.m
@@ -45,7 +45,7 @@ switch info(1)
     case 7
         message = sprintf('One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than %5.4f!\n If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.',DynareOptions.qz_zero_threshold);
     case 8
-        if size(info,2)>=2
+        if size(info,2)>=2 && info(2)~=0
             global M_;
             disp_string = M_.param_names{info(2)};
             for ii=1:length(info)-2
-- 
GitLab