Fix condition (variable name can have less than characters).

silicon
Stéphane Adjemian (Ryûk) 2023-03-04 17:13:45 +01:00
parent 66abd09b87
commit a0d53277c1
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ function str = print_equations(variable_name, withexpansion)
% OUTPUTS
% None
% Copyright © 2019-2021 Dynare Team
% Copyright © 2019-2023 Dynare Team
%
% This file is part of Dynare.
%
@ -65,7 +65,7 @@ for it = 1:length(M_.mapping.(variable_name).eqidx)
% Equations appended by the preprocessor for auxiliary variables are not displayed, except if it is an aux variable
% for the PAC expectation.
% TODO Probably should do the same for VAR expectation.
if isfield(M_, 'lhs') && isequal(M_.lhs{M_.mapping.(variable_name).eqidx(it)}(1:16), 'pac_expectation_')
if isfield(M_, 'lhs') && length(M_.lhs{M_.mapping.(variable_name).eqidx(it)})>15 && isequal(M_.lhs{M_.mapping.(variable_name).eqidx(it)}(1:16), 'pac_expectation_')
id = M_.mapping.(M_.lhs{M_.mapping.(variable_name).eqidx(it)}).eqidx(1);
else
continue