From d55b6c68f96cbd744b62adcb1554c10f401626cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Wed, 22 Nov 2023 17:06:52 +0100 Subject: [PATCH] =?UTF-8?q?Octave=20compatibility=20fix:=20sum(=E2=80=A6,?= =?UTF-8?q?=20'omitnan')=20does=20not=20exist=20under=20Octave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace it by nansum from the statistics package. --- matlab/evaluate_steady_state_file.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/matlab/evaluate_steady_state_file.m b/matlab/evaluate_steady_state_file.m index 14ef63a930..06760e9ec3 100644 --- a/matlab/evaluate_steady_state_file.m +++ b/matlab/evaluate_steady_state_file.m @@ -79,7 +79,11 @@ end if updated_params_flag && ~isreal(params1) info(1) = 23; - info(2) = sum(imag(params).^2,'omitnan'); + if ~isoctave + info(2) = sum(imag(params).^2,'omitnan'); + else + info(2) = nansum(imag(params).^2); + end if M_.set_auxiliary_variables ys = h_set_auxiliary_variables(ys,exo_ss,params); end @@ -114,4 +118,4 @@ if steady_state_checkflag info(1) = 22; return end -end \ No newline at end of file +end -- GitLab