From df5109d503d61c7259d5f6d962283adfa93bb2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 4 Apr 2023 18:35:50 +0200 Subject: [PATCH] Make matlab/missing/mex/mjdgges/mjdgges.m Octave-compatible [skip ci] --- matlab/missing/mex/mjdgges/mjdgges.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/matlab/missing/mex/mjdgges/mjdgges.m b/matlab/missing/mex/mjdgges/mjdgges.m index 85f2b78a44..5695618069 100644 --- a/matlab/missing/mex/mjdgges/mjdgges.m +++ b/matlab/missing/mex/mjdgges/mjdgges.m @@ -39,8 +39,8 @@ if nargin > 5 || nargin < 2 || nargout > 7 || nargout == 0 error('MJDGGES: takes 2, 3 or 4 input arguments and between 1 and 7 output arguments.') end -if isoctave - error('Octave unsupported, since it does not have real qz') +if isoctave && octave_ver_less_than('7') + error('Octave version 7 or higher is required (Octave 6 lacks the ordqz function)') end [me, ne] = size(e); @@ -56,7 +56,11 @@ end info = 0; try - [ss, tt, qq, zz] = qz(e, d, 'real'); + if isoctave + [ss, tt, qq, zz] = qz(e, d); + else + [ss, tt, qq, zz] = qz(e, d, 'real'); + end eigval = ordeig(ss, tt); select = abs(eigval) < qz_criterium; sdim = sum(select); @@ -82,4 +86,4 @@ catch t(1) = 0; end T = all(t); -%@eof:1 \ No newline at end of file +%@eof:1 -- GitLab