Do not add tag for block name if rootfolder is empty.

time-shift
Stéphane Adjemian (Odysseus) 2020-01-29 09:25:23 +01:00
parent d4e16b7ffe
commit bb302279ea
1 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,9 @@ for i=1:length(varargin)
error('An equation tag must be followed by an equation.')
end
% Add equation tag with block name.
model{j} = strcat('[block=''', getblockname(varargin{i}, rootfolder), ''',', model{j}(2:end));
if ~isempty(rootfolder)
model{j} = strcat('[block=''', 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});