1% For LICENSE / TERMS OF USE, see the file LICENSE in the root directory of the repository.
3% add folders and subfolders to the path
10% add the path to the savepath
15% function to add folders and subfolders to the path recursively
18 % check
if the path is already in the path (also in the temporary path)
19 if contains(path, pathdef)
25 % check
for hidden folders
26 if contains(path,
".")
30 % add the path to the path
32 addpath(genpath(path));
35 % get the subfolders of the current folder
37 folders = folders([folders.isdir]);
39 % display a message if the path was added
41 disp("Added " + folders(1).folder + " to the path.");
44 % recursively add subfolders to the path
45 for i = 1:length(folders)
46 if ~strcmp(folders(i).name, ".") && ~strcmp(folders(i).name, "..")
function recursiveAddPath(in path)