-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.m
57 lines (48 loc) · 1.32 KB
/
setup.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
50
51
52
53
54
55
56
57
function setup
% Setup script
% Authors: Pooyan Jamshidi ([email protected])
% The code is released under the FreeBSD License.
% Copyright (C) 2018 Pooyan Jamshidi
disp('setting path...');
pathCell = regexp(path, pathsep, 'split');
myDir = fileparts(mfilename('fullpath'));
paths = genpath(myDir);
paths = strread(paths, '%s', 'delimiter', ':');
pathsToAdd = [];
if ispc
del = '\';
else
del = '/';
end
for i=1:length(paths)
thisPath = paths{i};
thisPathSplit = strread(thisPath, '%s', 'delimiter', del);
addThisPath = 1;
% Do not add any directories or files starting with a . or a ~ or if it
% currently on the path
for j=1:length(thisPathSplit)
thisStr = thisPathSplit{j};
if (~isempty(thisStr)) && ((thisStr(1) == '.') || (thisStr(1) == '~')) || any(strcmpi(thisPath, pathCell))
addThisPath = 0;
end
end
if addThisPath ==1
if ~isempty(pathsToAdd)
thisPath = [':' thisPath];
end
pathsToAdd = [pathsToAdd thisPath];
end
end
if ~isempty(pathsToAdd)
addpath(pathsToAdd);
end
if ispc
rmpath('Controllers\RobusT2Scale')
else
rmpath('Controllers/RobusT2Scale')
end
rmpath('FQL4KE')
end
% if you want to not run this when you exit matlab uncomment this, use
% this: which pathdef.m -all
%savepath;