Fixed bug in setting blockname equation tag.
The blockname tag was overwritten (with the name of the LHS endogenous variable).time-shift
parent
6406bf97d4
commit
87e688011e
|
@ -70,10 +70,6 @@ for i=1:length(varargin)
|
||||||
if eqtag
|
if eqtag
|
||||||
error('An equation tag must be followed by an equation.')
|
error('An equation tag must be followed by an equation.')
|
||||||
end
|
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.
|
% Ensure that the equation tag name matches the LHS variable.
|
||||||
eqtagname = regexp(model{j}, 'name=''(\w*)''', 'match');
|
eqtagname = regexp(model{j}, 'name=''(\w*)''', 'match');
|
||||||
[lhs, ~] = getequation(model{j+1});
|
[lhs, ~] = getequation(model{j+1});
|
||||||
|
@ -86,6 +82,11 @@ for i=1:length(varargin)
|
||||||
else
|
else
|
||||||
model{j} = eqtagname_;
|
model{j} = eqtagname_;
|
||||||
end
|
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};
|
eqlist{tagnum,4} = model{j};
|
||||||
eqtag = true;
|
eqtag = true;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue