From 67a7e4357386a35a25597f40449b4d3fe7fb25a8 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Tue, 5 Feb 2019 14:51:11 +0100 Subject: [PATCH] gui: pass JSON as string --- matlab/+gui/+perfect-foresight/read.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/matlab/+gui/+perfect-foresight/read.m b/matlab/+gui/+perfect-foresight/read.m index a49694af9..f3bcccd33 100644 --- a/matlab/+gui/+perfect-foresight/read.m +++ b/matlab/+gui/+perfect-foresight/read.m @@ -1,9 +1,10 @@ -function read() -% function read() +function read(json) +% function read(json) % Read JSON and run perfect foresight solver % % INPUTS -% none +% json [string] JSON string representing options to run perfect +% foresight solver % % OUTPUTS % none @@ -30,8 +31,12 @@ function read() global M_ options_ oo_ ys0_ ex0_ +if nargin ~= 1 || ~ischar(json) + error('function takes one string input argument') +end + %loading JSON -jm = loadjson('perforin.JSON','SimplifyCell',0); +jm = loadjson(json,'SimplifyCell',0); data2json=struct(); %We test if jsonload loads string or char -- GitLab