-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathAddPaths.m
More file actions
19 lines (18 loc) · 806 Bytes
/
AddPaths.m
File metadata and controls
19 lines (18 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%-------------------------------------------------------------------------------
%% Add paths
%-------------------------------------------------------------------------------
fprintf(1,'Adding all subdirectories to the Matlab path...');
% Add paths required for the project (ignoring hidden, including version control)
files = dir;
directories = files([files.isdir]);
directories(strmatch('.',{files([files.isdir]).name})) = []; % remove hidden
if isfield(directories,'folder')
paths = arrayfun(@(x)fullfile(directories(x).folder,directories(x).name),1:length(directories),'UniformOutput',false);
else
paths = arrayfun(@(x)fullfile(pwd,directories(x).name),1:length(directories),'UniformOutput',false);
end
for j = 1:length(paths)
addpath(genpath(paths{j}))
end
fprintf(1,' Added.\n');
%%%%%%