Return 0 if the input is not the name of an endogenous variable.
Also removed the call to deprecated strmatch. [skip ci]time-shift
parent
81d9b08050
commit
3400e13c06
|
@ -8,7 +8,7 @@ function ida = get_aux_variable_id(var)
|
||||||
% OUTPUTS
|
% OUTPUTS
|
||||||
% - ida [integer] Corresponding index in M_.aux_vars.
|
% - ida [integer] Corresponding index in M_.aux_vars.
|
||||||
|
|
||||||
% Copyright (C) 2018 Dynare Team
|
% Copyright (C) 2018-2019 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -33,9 +33,10 @@ if isempty(var)
|
||||||
end
|
end
|
||||||
|
|
||||||
if ischar(var)
|
if ischar(var)
|
||||||
id = strmatch(var, M_.endo_names, 'exact');
|
id = find(strcmp(var, M_.endo_names));
|
||||||
if isempty(var)
|
if isempty(id)
|
||||||
error('Variable %s is unkown.', var)
|
ida = 0;
|
||||||
|
return
|
||||||
else
|
else
|
||||||
var = id;
|
var = id;
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue