initialize_dseries_toolbox.m 1.35 KB
Newer Older
1
% Check that the dates module is available.
2
3
4
try
    initialize_dates_toolbox;
catch
5
6
7
8
9
10
11
12
    urlwrite('https://github.com/DynareTeam/dates/archive/master.zip','master.zip');
    warning('off','MATLAB:MKDIR:DirectoryExists')
    mkdir('../externals')
    warning('on','MATLAB:MKDIR:DirectoryExists')
    unzip('master.zip','../externals')
    delete('master.zip')
    addpath([pwd() '/../externals/dates-master/src'])
    initialize_dates_toolbox;
13
14
15
16
17
18
19
20
21
22
23
end

% Get the path to the dseries toolbox.
dseries_src_root = strrep(which('initialize_dseries_toolbox'),'initialize_dseries_toolbox.m','');

% Add some subfolders to the path.
addpath([dseries_src_root '/read'])
addpath([dseries_src_root '/utilities/is'])
addpath([dseries_src_root '/utilities/str'])
addpath([dseries_src_root '/utilities/insert'])
addpath([dseries_src_root '/utilities/file'])
Stéphane Adjemian's avatar
Stéphane Adjemian committed
24
addpath([dseries_src_root '/utilities/from'])
25
26
27
28
29
30
31
32
33
34
35
36

% Add missing routines if dynare is not in the path
if ~exist('demean','file')
    addpath([dseries_src_root '/utilities/missing/demean'])
end

if ~exist('ndim','file')
    addpath([dseries_src_root '/utilities/missing/ndim'])
end

if ~exist('sample_hp_filter','file')
    addpath([dseries_src_root '/utilities/missing/sample_hp_filter'])
Stéphane Adjemian's avatar
Stéphane Adjemian committed
37
38
39
40
end

if isoctave && ~exist('user_has_octave_forge_package','file')
    addpath([dseries_src_root '/utilities/missing/user_has_octave_forge_package'])
Stéphane Adjemian's avatar
Stéphane Adjemian committed
41
end