Fixed import of tags on exogenous variables.

time-shift
Stéphane Adjemian (Charybdis) 2019-10-01 12:24:20 +02:00
parent fb3335f191
commit 2201c4e745
1 changed files with 7 additions and 3 deletions

View File

@ -142,12 +142,16 @@ if ~isequal(length(i1),rows(eqlist))
end
i2 = setdiff(1:rows(elist), i1);
xlist = [xlist; elist(i2,:)];
[~,idx] = unique(xlist(:,1)); % Ensure that the exogenous variable names are unique.
xlist=[xlist(idx,1) xlist(idx,2)]; % We do not test that the tags are the same.
[~,idx] = unique(xlist(:,1)); % Ensure that the exogenous variable names are unique.
xlist = [xlist(idx,1) xlist(idx,2)]; % We do not test that the tags are the same.
elist = elist(i1,:);
% Remove endogenous variables from list of exogenous variables (if any).
xlist = setdiff(xlist, elist);
xlist1 = xlist(:,1);
xlist2 = xlist(:,2);
[xlist1, id] = setdiff(xlist1, elist(:,1));
xlist2 = xlist2(id);
xlist = [xlist1, xlist2];
% Print all cherry-picked models in one mod-file.
[filepath, filename, fileext] = fileparts(ofile);