Fixed check on equation tag (plot_contributions).
parent
71ad2cf13b
commit
4a646e4ab3
|
@ -22,7 +22,7 @@ function plot_contributions(equationname, ds1, ds0)
|
|||
% [name='Phillips curve']
|
||||
% pi = beta*pi(1) + slope*y + lam;
|
||||
|
||||
% Copyright (C) 2017-2018 Dynare Team
|
||||
% Copyright (C) 2017 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -56,6 +56,11 @@ 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('There is no equation named as %s!', equationname);
|
||||
end
|
||||
|
||||
% Check second argument
|
||||
if ischar(ds1)
|
||||
if ismember(ds1, evalin('caller','who'))
|
||||
|
@ -96,7 +101,6 @@ 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