Cosmetic changes.

silicon
Stéphane Adjemian (Ryûk) 2023-03-04 18:03:59 +01:00
parent f6a76066f9
commit 656a7bf867
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 8 additions and 4 deletions

View File

@ -33,10 +33,11 @@ if ~nargin
error('Provide endogenous variable name as first input argument.');
end
jname = sprintf('%s%smodel%sjson%smodfile-original.json', M_.fname, filesep, filesep, filesep);
% Check if corresponding JSON file exists.
fname = [M_.fname filesep 'model' filesep 'json' filesep 'modfile-original.json'];
if exist(fname, 'file') ~= 2
error('Could not find %s! Please use the json option (See the Dynare invocation section in the reference manual).', fname);
if exist(jname, 'file') ~= 2
error('Please use the json option (See the Dynare invocation section in the reference manual).');
end
% Check that the first input is a character array.
@ -50,7 +51,7 @@ if ~ismember(variablename, [M_.exo_names; M_.endo_names])
end
% Load the JSON file.
jsonfile = loadjson_(fname);
jsonfile = loadjson_(jname);
model = jsonfile.model;
% Print the equations the variable appears in.
@ -92,9 +93,12 @@ for it = 1:length(M_.mapping.(variablename).eqidx)
if nargout
str = sprintf('%s = %s;\n', model{M_.mapping.(variablename).eqidx(it)}.lhs, rhs);
end
skipline()
fprintf('%s = %s;\n', model{id}.lhs, rhs);
end
skipline()
function [transformed_expression] = TransformExpandedExpr(expression)
transformed_expression = splitlines(expression);
transformed_expression{1} = sprintf(' + %s', transformed_expression{1});