diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 0b36a161a5e885cdbac7874c4d7906e9f36934f2..9be0d8458333770cf1c8f62b68095aee240150a2 100644 --- a/matlab/dynare_config.m +++ b/matlab/dynare_config.m @@ -129,9 +129,9 @@ if ~isoctave && matlab_ver_less_than('8.1') p{end+1} = '/missing/strsplit'; end -% isrow is missing in Matlab<R2010b +% isrow, iscolumn and ismatrix are missing in Matlab<R2010b if ~isoctave && matlab_ver_less_than('7.11') - p{end+1} = '/missing/isrow'; + p{end+1} = '/missing/is-row-column-matrix'; end P = cellfun(@(c)[dynareroot(1:end-1) c], p, 'uni',false); diff --git a/matlab/missing/is-row-column-matrix/iscolumn.m b/matlab/missing/is-row-column-matrix/iscolumn.m new file mode 100644 index 0000000000000000000000000000000000000000..0264efe198287e63a59ace53cd068b8376ceefda --- /dev/null +++ b/matlab/missing/is-row-column-matrix/iscolumn.m @@ -0,0 +1,20 @@ +function r = iscolumn(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 <http://www.gnu.org/licenses/>. + +sz = size(V); +r = (length(sz) == 2) && (sz(2) == 1); diff --git a/matlab/missing/is-row-column-matrix/ismatrix.m b/matlab/missing/is-row-column-matrix/ismatrix.m new file mode 100644 index 0000000000000000000000000000000000000000..e9ed4ef2dbab191420bc7fa851e6aba8744f8de3 --- /dev/null +++ b/matlab/missing/is-row-column-matrix/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 <http://www.gnu.org/licenses/>. + +r = (ndims(V) == 2); diff --git a/matlab/missing/isrow/isrow.m b/matlab/missing/is-row-column-matrix/isrow.m similarity index 93% rename from matlab/missing/isrow/isrow.m rename to matlab/missing/is-row-column-matrix/isrow.m index 31eabdbe67e71b6fbcf6d9500dd9dcbbe5193475..ef53534ede0596453d55e1d7fc36ed66499816b4 100644 --- a/matlab/missing/isrow/isrow.m +++ b/matlab/missing/is-row-column-matrix/isrow.m @@ -16,5 +16,5 @@ function r = isrow(V) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -[m, n] = size(V); -r = (m == 1); +sz = size(V); +r = (length(sz) == 2) && (sz(1) == 1);