From 4b867895a3ab5562a4e12f7059bf77cfbc73276c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 18 Sep 2019 15:45:11 +0200 Subject: [PATCH] dates.subsref: compatibility fix for MATLAB < R2010b Provide an alternative implementation of ismatrix. --- src/initialize_dseries_class.m | 6 +++++- src/utilities/missing/ismatrix/ismatrix.m | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/utilities/missing/ismatrix/ismatrix.m diff --git a/src/initialize_dseries_class.m b/src/initialize_dseries_class.m index 1548145..85d2a05 100644 --- a/src/initialize_dseries_class.m +++ b/src/initialize_dseries_class.m @@ -112,8 +112,12 @@ if ~exist('one_sided_hp_filter','file') p{end+1} = 'utilities/missing/one_sided_hp_filter'; end +if ~exist('ismatrix','file') + p{end+1} = 'utilities/missing/ismatrix'; +end + % Set path P = cellfun(@(c)[dseries_src_root c], p, 'uni', false); addpath(P{:}); -assignin('caller', 'dseries_src_root', dseries_src_root); \ No newline at end of file +assignin('caller', 'dseries_src_root', dseries_src_root); diff --git a/src/utilities/missing/ismatrix/ismatrix.m b/src/utilities/missing/ismatrix/ismatrix.m new file mode 100644 index 0000000..e9ed4ef --- /dev/null +++ b/src/utilities/missing/ismatrix/ismatrix.m @@ -0,0 +1,19 @@ +function r = ismatrix(V) +% Copyright (C) 2018 Dynare Team +% +% This file is part of Dynare. +% +% Dynare is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see . + +r = (ndims(V) == 2); -- GitLab