-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.m
53 lines (36 loc) · 1.37 KB
/
install.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% install - adds the directories for the simulation to the path
%
% Syntax: install(reInstallFlag)
% :reInstallFlag: (boolean) when true the folders are re-installed
% Protect function against clear
%persistent MONSTER;
% Initialize MONSTER on creation
restoredefaultpath
% Check if previous initialization was successful
root = mfilename('fullpath');
% Get directory of this file
root = root(1:find(root==filesep,1,'last')-1);
setpref('monster','monsterRootFolder',root);
fprintf(1,'(MONSTER - install) Adding directories to path:\n');
fprintf('-> %s\n',root);
if isunix
addpath(genpath('./'))
end
addpath(root);
dirs = {'examples','utils', 'channel', 'enb', 'layout','mac', 'mobility', 'phy', 'results', 'rlc', ...
'setup', 'scenarios', 'tests', 'traffic', 'ue', 'validator', 'logs', 'backhaul'};
for i=1:numel(dirs)
add = [root filesep dirs{i}];
fprintf('-> %s\\*\n',add);
addpath(genpath(add));
end
if verLessThan('matlab', '8.1.0')
fprintf(1, '(MONSTER - install) Adding compatibility layer for MATLAB releases before 8.1.0 (R2013a).\n');
addpath(genpath(fullfile(root, 'compatibility', '8.1')));
end
if verLessThan('matlab', '8.5.0')
fprintf(1, '(MONSTER - install) Adding compatibility layer for MATLAB releases before 8.5.0 (R2015a).\n');
addpath(genpath(fullfile(root, 'compatibility', '8.5')));
end
% Disable warnings
warning('off','catstruct:DuplicatesFound');