From 87e688011eb3bea4a60351e21cbc13955c4952ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Tue, 11 Feb 2020 19:09:33 +0100 Subject: [PATCH] Fixed bug in setting blockname equation tag. The blockname tag was overwritten (with the name of the LHS endogenous variable). --- matlab/aggregate.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/matlab/aggregate.m b/matlab/aggregate.m index e64b70fbf..45347d1cf 100644 --- a/matlab/aggregate.m +++ b/matlab/aggregate.m @@ -70,10 +70,6 @@ for i=1:length(varargin) if eqtag error('An equation tag must be followed by an equation.') end - % Add equation tag with block name. - if ~isempty(rootfolder) - model{j} = strcat('[blockname=''', getblockname(varargin{i}, rootfolder), ''',', model{j}(2:end)); - end % Ensure that the equation tag name matches the LHS variable. eqtagname = regexp(model{j}, 'name=''(\w*)''', 'match'); [lhs, ~] = getequation(model{j+1}); @@ -86,6 +82,11 @@ for i=1:length(varargin) else model{j} = eqtagname_; end + % Add equation tag with block name. + if ~isempty(rootfolder) + getblockname(varargin{i}, rootfolder) + model{j} = strcat('[blockname=''', getblockname(varargin{i}, rootfolder), ''',', model{j}(2:end)); + end eqlist{tagnum,4} = model{j}; eqtag = true; else