Skip to content
Snippets Groups Projects
Unverified Commit 3400e13c authored by Stéphane Adjemian (Charybdis)'s avatar Stéphane Adjemian (Charybdis)
Browse files

Return 0 if the input is not the name of an endogenous variable.

Also removed the call to deprecated strmatch.

[skip ci]
parent 81d9b080
Branches
Tags
No related merge requests found
Pipeline #906 skipped
......@@ -8,7 +8,7 @@ function ida = get_aux_variable_id(var)
% OUTPUTS
% - 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.
%
......@@ -33,9 +33,10 @@ if isempty(var)
end
if ischar(var)
id = strmatch(var, M_.endo_names, 'exact');
if isempty(var)
error('Variable %s is unkown.', var)
id = find(strcmp(var, M_.endo_names));
if isempty(id)
ida = 0;
return
else
var = id;
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment