Skip to content
Snippets Groups Projects
Commit b4568f07 authored by Dóra Kocsis's avatar Dóra Kocsis
Browse files

enforce use of jsonlab only when MATLAB < 9.1 and Unix end-of-line convention

parent a95329e1
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,7 @@ function initialize_mdbnomics() ...@@ -21,8 +21,7 @@ function initialize_mdbnomics()
mdbnomics_src_root = strrep(which('initialize_mdbnomics'), 'initialize_mdbnomics.m', ''); mdbnomics_src_root = strrep(which('initialize_mdbnomics'), 'initialize_mdbnomics.m', '');
% Set the subfolders to be added in the path. % Set the subfolders to be added in the path.
p = {'utils' ; ... p = {'utils'};
'/../contrib/jsonlab'};
% Add missing routines if dynare is not in the path % Add missing routines if dynare is not in the path
if ~exist('OCTAVE_VERSION', 'builtin') || ~exist('contains','builtin') if ~exist('OCTAVE_VERSION', 'builtin') || ~exist('contains','builtin')
...@@ -49,9 +48,14 @@ end ...@@ -49,9 +48,14 @@ end
P = cellfun(@(c)[mdbnomics_src_root c], p, 'uni', false); P = cellfun(@(c)[mdbnomics_src_root c], p, 'uni', false);
addpath(P{:}); addpath(P{:});
% Check minimal MATLAB and Octave requirements. % Check minimal MATLAB requirements.
if matlab_ver_less_than('8.5') if matlab_ver_less_than('8.5')
error('The minimum MATLAB requirement of this package is R2015a.'); error('The minimum MATLAB requirement of this package is R2015a.');
end end
% Add jsonlab if MATLAB version < R2016b
if matlab_ver_less_than('9.1')
addpath([mdbnomics_src_root '/../contrib/jsonlab']);
end
assignin('caller', 'mdbnomics_src_root', mdbnomics_src_root); assignin('caller', 'mdbnomics_src_root', mdbnomics_src_root);
...@@ -54,7 +54,7 @@ for gg = 1:size(grouped_series, 2) ...@@ -54,7 +54,7 @@ for gg = 1:size(grouped_series, 2)
posted_series_list{series} = posted_series; posted_series_list{series} = posted_series;
end end
if matlab_ver_less_than('9.8') if matlab_ver_less_than('9.1')
posted_series_list = savejson('',posted_series_list, 'Compact', 1); posted_series_list = savejson('',posted_series_list, 'Compact', 1);
posted_series_list = regexprep(posted_series_list,{' [[',']]'},{'[',']'}); posted_series_list = regexprep(posted_series_list,{' [[',']]'},{'[',']'});
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment