Skip to content
Snippets Groups Projects
Commit 503b055d authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fixed bugs in varlist_indices.m (thanks to Johannes Pfeifer for pointing them)

parent 92b1451c
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ function [i_var,nvar] = varlist_indices(sublist,list) ...@@ -13,7 +13,7 @@ function [i_var,nvar] = varlist_indices(sublist,list)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2010 Dynare Team % Copyright (C) 2010-2011 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -37,7 +37,7 @@ else ...@@ -37,7 +37,7 @@ else
check = []; check = [];
i_var = []; i_var = [];
for i = 1:rows(sublist) for i = 1:rows(sublist)
tmp = strmatch(sublist(i,:), list, 'exact'); tmp = strmatch(deblank(sublist(i,:)), list, 'exact');
if isempty(tmp) if isempty(tmp)
check = [ check; 0 ]; check = [ check; 0 ];
else else
...@@ -50,7 +50,10 @@ end ...@@ -50,7 +50,10 @@ end
nvar = length(i_var); nvar = length(i_var);
if ~all(check) if ~all(check)
k =find(check); k = find(~check);
error(strcat(sublist(k,:),' hasn''t been declared')) tempstring = 'The following symbols are not endogenous variables: ';
for ii = 1:length(k)
tempstring = [ tempstring, deblank(sublist(k(ii),:)), ' ' ];
end
error(tempstring)
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment