plot_contributions: if getEquationsByTags returns an empty jsonmodel, we know that no equation was found with `equationname` so simplify check
parent
8f66bc97eb
commit
c671b78952
|
@ -56,11 +56,6 @@ if ~ischar(equationname)
|
|||
error('First argument must be a string.')
|
||||
end
|
||||
|
||||
% Check that the equation name is actually the name of an equation in the model.
|
||||
if ~ismember(equationname, M_.equations_tags(strmatch('name', M_.equations_tags(:,2)),3))
|
||||
error('plot_contributions:: There is no equation named as %s!', equationname);
|
||||
end
|
||||
|
||||
% Check second argument
|
||||
if ischar(ds1)
|
||||
if ismember(ds1, evalin('caller','who'))
|
||||
|
@ -101,6 +96,7 @@ end
|
|||
jsonmodel = loadjson(jsonfile);
|
||||
jsonmodel = jsonmodel.model;
|
||||
jsonmodel = getEquationsByTags(jsonmodel, 'name', equationname);
|
||||
assert(~isempty(jsonmodel), ['No equation found with tag name: ' equationname]);
|
||||
lhs = jsonmodel{1}.lhs;
|
||||
rhs = jsonmodel{1}.rhs;
|
||||
|
||||
|
|
Loading…
Reference in New Issue