https://github.com/idse/PGCs
Raw File
Tip revision: 9c52edf907e9d4251ada6b85a99f4edc13784eeb authored by Idse Heemskerk on 28 March 2022, 23:55:16 UTC
updates after revision
Tip revision: 9c52edf
setup.m
%-----------------------------------------
% 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'));
back to top