Bump minimal MATLAB version to R2014a

Ref. #1713
parent e95b93f7
...@@ -2,7 +2,7 @@ variables: ...@@ -2,7 +2,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
TERM: linux TERM: linux
MATLAB_VERSION: R2020a MATLAB_VERSION: R2020a
OLD_MATLAB_VERSION: R2009b OLD_MATLAB_VERSION: R2014a
# The next stanza creates the version number used for the source tarball and the # The next stanza creates the version number used for the source tarball and the
# binary packages. Here are the following possible cases: # binary packages. Here are the following possible cases:
......
...@@ -14,7 +14,7 @@ are necessary in that case. ...@@ -14,7 +14,7 @@ are necessary in that case.
In order to run Dynare, you need one of the following: In order to run Dynare, you need one of the following:
* MATLAB version 7.9 (R2009b) or above; * MATLAB version 8.3 (R2014a) or above;
* GNU Octave version 4.4 or above, with the statistics package from * GNU Octave version 4.4 or above, with the statistics package from
`Octave-Forge`_. Note however that the Dynare installers for Windows and `Octave-Forge`_. Note however that the Dynare installers for Windows and
macOS require a more specific version of Octave, as indicated on the download macOS require a more specific version of Octave, as indicated on the download
......
...@@ -207,12 +207,6 @@ Copyright: 1993-1996 Kurt Hornik ...@@ -207,12 +207,6 @@ Copyright: 1993-1996 Kurt Hornik
2016-2017 Dynare Team 2016-2017 Dynare Team
License: GPL-3+ License: GPL-3+
Files: matlab/missing/strjoin/strjoin.m
Copyright: 2013-2019 Ben Abbott
2007 Muthiah Annamalai
2019 Dynare Team
License: GPL-3+
Files: matlab/lmmcp/catstruct.m Files: matlab/lmmcp/catstruct.m
Copyright: 2005 Jos van der Geest <jos@jasen.nl> Copyright: 2005 Jos van der Geest <jos@jasen.nl>
2013 Christophe Gouel 2013 Christophe Gouel
......
...@@ -22,7 +22,7 @@ AC_REQUIRE([AX_MATLAB_ARCH]) ...@@ -22,7 +22,7 @@ AC_REQUIRE([AX_MATLAB_ARCH])
AC_REQUIRE([AX_MATLAB_VERSION]) AC_REQUIRE([AX_MATLAB_VERSION])
AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_SED])
AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [7.9], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 7.9 (R2009b) at least.])]) AX_COMPARE_VERSION([$MATLAB_VERSION], [lt], [8.3], [AC_MSG_ERROR([Your MATLAB is too old, please upgrade to 8.3 (R2014a) at least.])])
AC_MSG_CHECKING([for options to compile MEX for MATLAB]) AC_MSG_CHECKING([for options to compile MEX for MATLAB])
...@@ -80,10 +80,6 @@ case ${MATLAB_ARCH} in ...@@ -80,10 +80,6 @@ case ${MATLAB_ARCH} in
;; ;;
esac esac
# Kludge for incompatibility of older MATLABs (≤ R2011a) with recent gcc
# Include <uchar.h>, because matrix.h needs char16_t
AX_COMPARE_VERSION([$MATLAB_VERSION], [le], [7.12], [MATLAB_CFLAGS="$MATLAB_CFLAGS -include uchar.h"])
# Converts the MATLAB version number into comparable integers with only major and minor version numbers # Converts the MATLAB version number into comparable integers with only major and minor version numbers
# For example, 7.4.2 will become 0704 # For example, 7.4.2 will become 0704
ax_matlab_ver=$(echo "$MATLAB_VERSION" | $SED -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/Z\1ZZ\2Z/' \ ax_matlab_ver=$(echo "$MATLAB_VERSION" | $SED -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/Z\1ZZ\2Z/' \
......
...@@ -88,7 +88,7 @@ make -j"$NTHREADS" ...@@ -88,7 +88,7 @@ make -j"$NTHREADS"
NAME=dynare-"$VERSION" NAME=dynare-"$VERSION"
PKGFILES="$ROOTDIR"/macOS/pkg/"$NAME" PKGFILES="$ROOTDIR"/macOS/pkg/"$NAME"
mkdir -p \ mkdir -p \
"$PKGFILES"/mex/matlab/maci64-7.9-9.3 \ "$PKGFILES"/mex/matlab/maci64-8.3-9.3 \
"$PKGFILES"/mex/matlab/maci64-9.4-9.8 \ "$PKGFILES"/mex/matlab/maci64-9.4-9.8 \
"$PKGFILES"/mex/octave \ "$PKGFILES"/mex/octave \
"$PKGFILES"/doc/dynare++ \ "$PKGFILES"/doc/dynare++ \
...@@ -107,7 +107,7 @@ cp -p "$ROOTDIR"/license.txt "$PKGFILES" ...@@ -107,7 +107,7 @@ cp -p "$ROOTDIR"/license.txt "$PKGFILES"
cp -pr "$ROOTDIR"/matlab "$PKGFILES" cp -pr "$ROOTDIR"/matlab "$PKGFILES"
cp -pr "$ROOTDIR"/examples "$PKGFILES" cp -pr "$ROOTDIR"/examples "$PKGFILES"
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-7.9-9.3 cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-8.3-9.3
cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts
cp -pr "$ROOTDIR"/contrib/ms-sbvar/TZcode/MatlabFiles "$PKGFILES"/contrib/ms-sbvar/TZcode cp -pr "$ROOTDIR"/contrib/ms-sbvar/TZcode/MatlabFiles "$PKGFILES"/contrib/ms-sbvar/TZcode
......
function mexpath = add_path_to_mex_files(dynareroot, modifypath) function mexpath = add_path_to_mex_files(dynareroot, modifypath)
% Copyright (C) 2015-2019 Dynare Team % Copyright (C) 2015-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -54,7 +54,7 @@ if isoctave ...@@ -54,7 +54,7 @@ if isoctave
else else
% Add win32 specific paths for Dynare Windows package % Add win32 specific paths for Dynare Windows package
if strcmp(computer, 'PCWIN') if strcmp(computer, 'PCWIN')
tmp = [dynareroot '../mex/matlab/win32-7.9-8.6/']; tmp = [dynareroot '../mex/matlab/win32-8.3-8.6/'];
if exist(tmp, 'dir') if exist(tmp, 'dir')
mexpath = tmp; mexpath = tmp;
if modifypath if modifypath
...@@ -65,7 +65,7 @@ else ...@@ -65,7 +65,7 @@ else
% Add win64 specific paths for Dynare Windows package % Add win64 specific paths for Dynare Windows package
if strcmp(computer, 'PCWIN64') if strcmp(computer, 'PCWIN64')
if matlab_ver_less_than('9.4') if matlab_ver_less_than('9.4')
tmp = [dynareroot '../mex/matlab/win64-7.9-9.3/']; tmp = [dynareroot '../mex/matlab/win64-8.3-9.3/'];
if exist(tmp, 'dir') if exist(tmp, 'dir')
mexpath = tmp; mexpath = tmp;
if modifypath if modifypath
...@@ -85,7 +85,7 @@ else ...@@ -85,7 +85,7 @@ else
% Add macOS paths for Dynare Mac package % Add macOS paths for Dynare Mac package
if strcmp(computer, 'MACI64') if strcmp(computer, 'MACI64')
if matlab_ver_less_than('9.4') if matlab_ver_less_than('9.4')
tmp = [dynareroot '../mex/matlab/maci64-7.9-9.3/']; tmp = [dynareroot '../mex/matlab/maci64-8.3-9.3/'];
if exist(tmp, 'dir') if exist(tmp, 'dir')
mexpath = tmp; mexpath = tmp;
if modifypath if modifypath
......
...@@ -17,7 +17,7 @@ function oo_ = compute_moments_varendo(type, options_, M_, oo_, var_list_) ...@@ -17,7 +17,7 @@ function oo_ = compute_moments_varendo(type, options_, M_, oo_, var_list_)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2008-2018 Dynare Team % Copyright (C) 2008-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -145,7 +145,7 @@ if M_.exo_nbr > 1 ...@@ -145,7 +145,7 @@ if M_.exo_nbr > 1
end end
skipline(); skipline();
if ~all(M_.H==0) if ~all(M_.H==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_name_requested_vars, varlist_pos] = intersect_stable(var_list_, options_.varobs); [observable_name_requested_vars, varlist_pos] = intersect_stable(var_list_, options_.varobs);
else else
[observable_name_requested_vars, varlist_pos] = intersect(var_list_, options_.varobs, 'stable'); [observable_name_requested_vars, varlist_pos] = intersect(var_list_, options_.varobs, 'stable');
......
...@@ -17,7 +17,7 @@ function [ConditionalVarianceDecomposition, ConditionalVarianceDecomposition_ME] ...@@ -17,7 +17,7 @@ function [ConditionalVarianceDecomposition, ConditionalVarianceDecomposition_ME]
% h is the number of Steps % h is the number of Steps
% p is the number of state innovations and % p is the number of state innovations and
% Copyright (C) 2010-2017 Dynare Team % Copyright (C) 2010-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -89,7 +89,7 @@ end ...@@ -89,7 +89,7 @@ end
% Measurement error % Measurement error
if ~all(StateSpaceModel.measurement_error==0) if ~all(StateSpaceModel.measurement_error==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos,index_subset,index_observables]=intersect_stable(SubsetOfVariables,StateSpaceModel.observable_pos); [observable_pos,index_subset,index_observables]=intersect_stable(SubsetOfVariables,StateSpaceModel.observable_pos);
else else
[observable_pos,index_subset,index_observables]=intersect(SubsetOfVariables,StateSpaceModel.observable_pos,'stable'); [observable_pos,index_subset,index_observables]=intersect(SubsetOfVariables,StateSpaceModel.observable_pos,'stable');
......
...@@ -22,7 +22,7 @@ function oo_ = ... ...@@ -22,7 +22,7 @@ function oo_ = ...
% OUTPUTS % OUTPUTS
% oo_ [structure] Dynare structure where the results are saved. % oo_ [structure] Dynare structure where the results are saved.
% Copyright (C) 2017-2018 Dynare Team % Copyright (C) 2017-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -63,7 +63,7 @@ if isempty(exogenous_variable_index) ...@@ -63,7 +63,7 @@ if isempty(exogenous_variable_index)
end end
end end
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(var_list,options_.varobs); [observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(var_list,options_.varobs);
else else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(var_list,options_.varobs,'stable'); [observable_pos_requested_vars,index_subset,index_observables]=intersect(var_list,options_.varobs,'stable');
......
...@@ -11,7 +11,7 @@ function oo_=disp_moments(y,var_list,M_,options_,oo_) ...@@ -11,7 +11,7 @@ function oo_=disp_moments(y,var_list,M_,options_,oo_)
% OUTPUTS % OUTPUTS
% oo_ [structure] Dynare's results structure, % oo_ [structure] Dynare's results structure,
% Copyright (C) 2001-2019 Dynare Team % Copyright (C) 2001-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -50,7 +50,7 @@ y = y(ivar,options_.drop+1:end)'; ...@@ -50,7 +50,7 @@ y = y(ivar,options_.drop+1:end)';
ME_present=0; ME_present=0;
if ~all(M_.H==0) if ~all(M_.H==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos_requested_vars, index_subset, index_observables] = intersect_stable(ivar, options_.varobs_id); [observable_pos_requested_vars, index_subset, index_observables] = intersect_stable(ivar, options_.varobs_id);
else else
[observable_pos_requested_vars, index_subset, index_observables] = intersect(ivar, options_.varobs_id, 'stable'); [observable_pos_requested_vars, index_subset, index_observables] = intersect(ivar, options_.varobs_id, 'stable');
......
...@@ -2,7 +2,7 @@ function oo_ = disp_th_moments(dr, var_list, M_, options_, oo_) ...@@ -2,7 +2,7 @@ function oo_ = disp_th_moments(dr, var_list, M_, options_, oo_)
% Display theoretical moments of variables % Display theoretical moments of variables
% Copyright (C) 2001-2018 Dynare Team % Copyright (C) 2001-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -55,7 +55,7 @@ oo_.var = oo_.gamma_y{1}; ...@@ -55,7 +55,7 @@ oo_.var = oo_.gamma_y{1};
ME_present=0; ME_present=0;
if ~all(M_.H==0) if ~all(M_.H==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id); [observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable'); [observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
...@@ -105,7 +105,7 @@ if size(stationary_vars, 1) > 0 ...@@ -105,7 +105,7 @@ if size(stationary_vars, 1) > 0
lh = cellofchararraymaxlength(M_.endo_names(ivar(stationary_vars)))+2; lh = cellofchararraymaxlength(M_.endo_names(ivar(stationary_vars)))+2;
dyntable(options_, title, headers, M_.endo_names(ivar(stationary_vars)), 100*oo_.gamma_y{options_.ar+2}(stationary_vars,:), lh, 8, 2); dyntable(options_, title, headers, M_.endo_names(ivar(stationary_vars)), 100*oo_.gamma_y{options_.ar+2}(stationary_vars,:), lh, 8, 2);
if ME_present if ME_present
if isoctave || matlab_ver_less_than('8.1') if isoctave
[stationary_observables, pos_index_subset] = intersect_stable(index_subset, stationary_vars); [stationary_observables, pos_index_subset] = intersect_stable(index_subset, stationary_vars);
else else
[stationary_observables, pos_index_subset] = intersect(index_subset, stationary_vars, 'stable'); [stationary_observables, pos_index_subset] = intersect(index_subset, stationary_vars, 'stable');
......
...@@ -16,7 +16,7 @@ function [ldens,Dldens,D2ldens] = lpdfgweibull(x,a,b,c) % --*-- Unitary tests - ...@@ -16,7 +16,7 @@ function [ldens,Dldens,D2ldens] = lpdfgweibull(x,a,b,c) % --*-- Unitary tests -
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2015-2017 Dynare Team % Copyright (C) 2015-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -205,7 +205,7 @@ end ...@@ -205,7 +205,7 @@ end
%$ density = @(x) exp(lpdfgweibull(x,shape,scale)); %$ density = @(x) exp(lpdfgweibull(x,shape,scale));
%$ %$
%$ try %$ try
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s = quadl(density, .0000000001, 100000, 1e-10); %$ s = quadl(density, .0000000001, 100000, 1e-10);
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
...@@ -228,7 +228,7 @@ end ...@@ -228,7 +228,7 @@ end
%$ density = @(x) exp(lpdfgweibull(x,shape,scale)); %$ density = @(x) exp(lpdfgweibull(x,shape,scale));
%$ %$
%$ try %$ try
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s = quadl(density, .0000000001, 100000, 1e-10); %$ s = quadl(density, .0000000001, 100000, 1e-10);
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
...@@ -251,7 +251,7 @@ end ...@@ -251,7 +251,7 @@ end
%$ density = @(x) exp(lpdfgweibull(x,shape,scale)); %$ density = @(x) exp(lpdfgweibull(x,shape,scale));
%$ %$
%$ try %$ try
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s = quadl(density, .0000000001, 100000, 1e-10); %$ s = quadl(density, .0000000001, 100000, 1e-10);
%$ else %$ else
%$ s = integral(density, 0, 100000); %$ s = integral(density, 0, 100000);
...@@ -262,7 +262,7 @@ end ...@@ -262,7 +262,7 @@ end
%$ end %$ end
%$ %$
%$ if t(1) %$ if t(1)
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ t(2) = abs(s-1)<5e-5; %$ t(2) = abs(s-1)<5e-5;
%$ else %$ else
%$ t(2) = abs(s-1)<1e-6; %$ t(2) = abs(s-1)<1e-6;
...@@ -280,8 +280,6 @@ end ...@@ -280,8 +280,6 @@ end
%$ try %$ try
%$ if isoctave %$ if isoctave
%$ s = quadgk(xdens, .0000000001, 100000, 1e-10); %$ s = quadgk(xdens, .0000000001, 100000, 1e-10);
%$ elseif matlab_ver_less_than('7.14')
%$ s = quadgk(xdens, .0000000001, 100000, 'AbsTol', 1e-10);
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
%$ end %$ end
...@@ -303,7 +301,7 @@ end ...@@ -303,7 +301,7 @@ end
%$ xdens = @(x) x.*exp(lpdfgweibull(x,shape,scale)); %$ xdens = @(x) x.*exp(lpdfgweibull(x,shape,scale));
%$ %$
%$ try %$ try
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s = quadl(xdens, .0000000001, 100000, 1e-10); %$ s = quadl(xdens, .0000000001, 100000, 1e-10);
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
...@@ -326,7 +324,7 @@ end ...@@ -326,7 +324,7 @@ end
%$ xdens = @(x) x.*exp(lpdfgweibull(x,shape,scale)); %$ xdens = @(x) x.*exp(lpdfgweibull(x,shape,scale));
%$ %$
%$ try %$ try
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s = quadl(xdens, .0000000001, 100000, 1e-10); %$ s = quadl(xdens, .0000000001, 100000, 1e-10);
%$ else %$ else
%$ s = integral(xdens, 0, 100000); %$ s = integral(xdens, 0, 100000);
...@@ -352,7 +350,7 @@ end ...@@ -352,7 +350,7 @@ end
%$ try %$ try
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s(i) = quadl(density, .0000000001, .1*i, 1e-10); %$ s(i) = quadl(density, .0000000001, .1*i, 1e-10);
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
...@@ -383,7 +381,7 @@ end ...@@ -383,7 +381,7 @@ end
%$ try %$ try
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s(i) = quadl(density, .0000000001, .1*i, 1e-10); %$ s(i) = quadl(density, .0000000001, .1*i, 1e-10);
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
...@@ -414,7 +412,7 @@ end ...@@ -414,7 +412,7 @@ end
%$ try %$ try
%$ s = NaN(n, 1); %$ s = NaN(n, 1);
%$ for i=1:n %$ for i=1:n
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ s(i) = quadl(density, .0000000001, .1*i, 1e-10); %$ s(i) = quadl(density, .0000000001, .1*i, 1e-10);
%$ else %$ else
%$ s(i) = integral(density, 0, .1*i); %$ s(i) = integral(density, 0, .1*i);
...@@ -429,7 +427,7 @@ end ...@@ -429,7 +427,7 @@ end
%$ for i=1:n %$ for i=1:n
%$ x = .1*i; %$ x = .1*i;
%$ q = 1-exp(-(x/scale)^shape); %$ q = 1-exp(-(x/scale)^shape);
%$ if isoctave || matlab_ver_less_than('7.14') %$ if isoctave
%$ t(i+1) = abs(s(i)-q)<5e-5; %$ t(i+1) = abs(s(i)-q)<5e-5;
%$ else %$ else
%$ t(i+1) = abs(s(i)-q)<1e-6; %$ t(i+1) = abs(s(i)-q)<1e-6;
......
...@@ -83,7 +83,7 @@ MaXNumberOfConditionalDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSaved ...@@ -83,7 +83,7 @@ MaXNumberOfConditionalDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSaved
ME_present=0; ME_present=0;
if ~all(M_.H==0) if ~all(M_.H==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id); [observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable'); [observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
......
...@@ -86,7 +86,7 @@ MaXNumberOfDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPer ...@@ -86,7 +86,7 @@ MaXNumberOfDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPer
ME_present=0; ME_present=0;
if ~all(M_.H==0) if ~all(M_.H==0)
if isoctave || matlab_ver_less_than('8.1') if isoctave
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id); [observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable'); [observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
......
...@@ -82,10 +82,10 @@ if isoctave ...@@ -82,10 +82,10 @@ if isoctave
skipline() skipline()
end end
else else
if matlab_ver_less_than('7.9') % Should match the test in mex/build/matlab/configure.ac if matlab_ver_less_than('8.3') % Should match the test in mex/build/matlab/configure.ac
% and in m4/ax_mexopts.m4 % and in m4/ax_mexopts.m4
skipline() skipline()
warning('This version of Dynare has only been tested on MATLAB 7.9 (R2009b) and above. Since your MATLAB version is older than that, Dynare may fail to run, or give unexpected results. Consider upgrading your MATLAB installation, or switch to Octave.'); warning('This version of Dynare has only been tested on MATLAB 8.3 (R2014a) and above. Since your MATLAB version is older than that, Dynare may fail to run, or give unexpected results. Consider upgrading your MATLAB installation, or switch to Octave.');
skipline() skipline()
end end
end end
......
...@@ -87,8 +87,8 @@ if isoctave && octave_ver_less_than('5') ...@@ -87,8 +87,8 @@ if isoctave && octave_ver_less_than('5')
p{end+1} = '/missing/ordeig'; p{end+1} = '/missing/ordeig';
end end
%% intersect(…, 'stable') doesn't exist in Octave and in MATLAB < R2013a %% intersect(…, 'stable') doesn't exist in Octave
if isoctave || matlab_ver_less_than('8.1') if isoctave
p{end+1} = '/missing/intersect_stable'; p{end+1} = '/missing/intersect_stable';
end end
...@@ -116,33 +116,12 @@ if (isoctave && octave_ver_less_than('5')) || (~isoctave && matlab_ver_less_than ...@@ -116,33 +116,12 @@ if (isoctave && octave_ver_less_than('5')) || (~isoctave && matlab_ver_less_than
p{end+1} = '/missing/isfile'; p{end+1} = '/missing/isfile';
end end
% strsplit and strjoin are missing in MATLAB < R2013a
if ~isoctave && matlab_ver_less_than('8.1')
p{end+1} = '/missing/strsplit';
p{end+1} = '/missing/strjoin';
end
% contains and splitlines don't exist in Octave and in MATLAB < R2016b % contains and splitlines don't exist in Octave and in MATLAB < R2016b
if isoctave || matlab_ver_less_than('9.1') if isoctave || matlab_ver_less_than('9.1')
p{end+1} = '/missing/contains'; p{end+1} = '/missing/contains';
p{end+1} = '/missing/splitlines'; p{end+1} = '/missing/splitlines';
end end
% isrow, iscolumn and ismatrix are missing in Matlab<R2010b
if ~isoctave && matlab_ver_less_than('7.11')
p{end+1} = '/missing/is-row-column-matrix';
end
%% isdiag is missing in MATLAB < R2014a
if ~isoctave && matlab_ver_less_than('8.3')
p{end+1} = '/missing/isdiag';
end
%% narginchk is missing in MATLAB < R2011b
if ~isoctave && matlab_ver_less_than('7.13')
p{end+1} = '/missing/narginchk';
end
P = cellfun(@(c)[dynareroot(1:end-1) c], p, 'uni',false); P = cellfun(@(c)[dynareroot(1:end-1) c], p, 'uni',false);
% Get mex files folder(s) % Get mex files folder(s)
......
...@@ -6,7 +6,7 @@ function [state_u,state_n] = get_dynare_random_generator_state() ...@@ -6,7 +6,7 @@ function [state_u,state_n] = get_dynare_random_generator_state()
% For backward compatibility, we return two vectors, but, in recent % For backward compatibility, we return two vectors, but, in recent
% versions of Matlab and in Octave, we return two identical vectors. % versions of Matlab and in Octave, we return two identical vectors.
% Copyright (C) 2010-2017 Dynare Team % Copyright (C) 2010-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -23,14 +23,8 @@ function [state_u,state_n] = get_dynare_random_generator_state() ...@@ -23,14 +23,8 @@ function [state_u,state_n] = get_dynare_random_generator_state()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
matlab_random_streams = ~isoctave; if ~isoctave
s = RandStream.getGlobalStream();
if matlab_random_streams% Use new matlab interface.
if matlab_ver_less_than('7.12')
s = RandStream.getDefaultStream();
else
s = RandStream.getGlobalStream();
end
if isequal(s.Type,'legacy') if isequal(s.Type,'legacy')
state_u = rand('state'); state_u = rand('state');
state_n = randn('state'); state_n = randn('state');
...@@ -38,7 +32,7 @@ if matlab_random_streams% Use new matlab interface. ...@@ -38,7 +32,7 @@ if matlab_random_streams% Use new matlab interface.
state_u = s.State; state_u = s.State;
state_n = state_u; state_n = state_u;
end end
else% Use old matlab interface. else
state_u = rand('state'); state_u = rand('state');
state_n = randn('state'); state_n = randn('state');
end end
\ No newline at end of file
...@@ -327,7 +327,7 @@ if info(1) == 0 %no errors in solution ...@@ -327,7 +327,7 @@ if info(1) == 0 %no errors in solution
cmm = simulated_moment_uncertainty(ind_dMOMENTS, periods, replic,options_,