-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstartup.m
More file actions
30 lines (21 loc) · 735 Bytes
/
startup.m
File metadata and controls
30 lines (21 loc) · 735 Bytes
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
%{
Use on startup to add relevant SpectralSeg files to the matlab Path
In the below excludedPaths variable can add folder extensions to ignore
%}
excludedPaths = {'\.git', '\docs'};
currentDir = pwd;
excludePattern = cellfun(@(str) fullfile(currentDir, str), excludedPaths, 'UniformOutput', false);
allPaths = genpath(currentDir);
allPaths = strsplit(allPaths, pathsep);
allPaths = allPaths(~cellfun('isempty', allPaths));
keepPaths = true(size(allPaths));
for i = 1: length(excludedPaths)
keepPaths = keepPaths & ~contains(allPaths, excludedPaths{i});
end
filteredPaths = allPaths(keepPaths);
for i = 1: length(filteredPaths)
addpath(filteredPaths{i});
end
disp('Paths added to MATLAB:');
disp(filteredPaths');
clear