From bb302279ea5c8d3a2484f37e8af66a6f64f3102f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Odysseus=29?= Date: Wed, 29 Jan 2020 09:25:23 +0100 Subject: [PATCH] Do not add tag for block name if rootfolder is empty. --- matlab/aggregate.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matlab/aggregate.m b/matlab/aggregate.m index 79faa5220..1ff7859e9 100644 --- a/matlab/aggregate.m +++ b/matlab/aggregate.m @@ -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});