-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.m
26 lines (22 loc) · 835 Bytes
/
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
%-----------------------------------------
% set up path
%-----------------------------------------
% entries of matlab search path
pathentries = regexp(path, pathsep, 'split');
% find ones containing ImSAnE and remove from path
disp('removing old entries from path');
for i = 1:length(pathentries)
if ~isempty(regexp(pathentries{i}, 'HeemskerkLab','once'))...
|| ~isempty(regexp(pathentries{i}, 'heemskerklab','once'))
rmpath(pathentries{i});
end
end
%%
% path of current script is new ImSAnE directory
[repopath,~,ext] = fileparts(matlab.desktop.editor.getActiveFilename);
disp(['repo path: ' repopath]);
addpath(genpath(repopath));
disp('added directory containing setup.m and subdirectories to path');
% storing the path in the startup directory
upath = userpath;
savepath(fullfile(upath, 'pathdef.m'));