% % [] = PV_CHECKPATH() % % This function detects where the package gmaze_pv is installed % (the upper level directory where the function volbet2iso % is found) and ensure that sub-directories are in the path % function [] = pv_checkpath() % Windows/Linux compatibility global sla sla = '/'; if ispc , sla = '\'; end % Determine the directory name where the package is installed: w = which('volbet2iso'); packdir = w(1:length(w)-12); % Try to found needed subdirectories: subdir = struct('name',{'subfct','test'}); for id = 1 : size(subdir(:),1) subdirname = subdir(id).name; fullsubdir = strcat(packdir,sla,subdirname); if isempty(findstr(path,fullsubdir)) addpath(fullsubdir) end %if end %for