Fixed bug in setting blockname equation tag.

The blockname tag was overwritten (with the name of the LHS endogenous variable).
time-shift
Stéphane Adjemian (Charybdis) 2020-02-11 19:09:33 +01:00
parent 6406bf97d4
commit 87e688011e
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 5 additions and 4 deletions

View File

@ -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