Compatibility fix for MATLAB < R2019b

MATLAB < R2019b does not accept “bar(1, [2 3])”.
time-shift
Sébastien Villemot 2021-06-16 17:13:56 +02:00
parent 9460da5b07
commit 820df39ff7
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ function plot_identification(params, idemoments, idehess, idemodel, idelre, adva
% SPECIAL REQUIREMENTS
% None
% Copyright (C) 2008-2017 Dynare Team
% Copyright (C) 2008-2021 Dynare Team
%
% This file is part of Dynare.
%
@ -59,7 +59,8 @@ if SampleSize == 1
subplot(211)
mmm = (idehess.ide_strength_dMOMENTS);
[ss, is] = sort(mmm);
if ~all(isnan(idehess.ide_strength_dMOMENTS_prior))
if ~all(isnan(idehess.ide_strength_dMOMENTS_prior)) ...
&& ~(nparam == 1 && ~isoctave && matlab_ver_less_than('9.7')) % MATLAB < R2019b does not accept bar(1, [2 3])
bar(1:nparam,log([idehess.ide_strength_dMOMENTS(:,is)' idehess.ide_strength_dMOMENTS_prior(:,is)']))
else
bar(1:nparam,log([idehess.ide_strength_dMOMENTS(:,is)' ]))
@ -105,7 +106,8 @@ if SampleSize == 1
end
subplot(212)
if ~all(isnan(idehess.deltaM_prior))
if ~all(isnan(idehess.deltaM_prior)) ...
&& ~(nparam == 1 && ~isoctave && matlab_ver_less_than('9.7')) % MATLAB < R2019b does not accept bar(1, [2 3])
bar(1:nparam, log([idehess.deltaM(is) idehess.deltaM_prior(is)]))
else
bar(1:nparam, log([idehess.deltaM(is)]))