| 1 | % | % | 
| 2 | % [] = PV_CHECKPATH() | % [] = pv_checkpath() | 
| 3 | % | % | 
| 4 | % This function detects where the package gmaze_pv is installed | % This function detects where the package gmaze_pv is installed | 
| 5 | % (the upper level directory where the function volbet2iso | % (the upper level directory where the function volbet2iso | 
| 15 |  |  | 
| 16 |  |  | 
| 17 | % Determine the directory name where the package is installed: | % Determine the directory name where the package is installed: | 
| 18 | w       = which('volbet2iso'); | fct_to_find = 'pv_checkpath'; | 
| 19 | packdir = w(1:length(w)-12); | w       = which(fct_to_find); | 
| 20 |  | packdir = w(1:length(w)-(length(fct_to_find)+2)); | 
| 21 |  |  | 
| 22 |  |  | 
| 23 | % Try to found needed subdirectories: | % Try to found needed subdirectories: | 
| 24 | subdir     = 'subfct'; |  | 
| 25 | fullsubdir = strcat(packdir,sla,subdir); | subdir     = struct('name',{'subfct','test','visu','subduc'}); | 
| 26 | if isempty(findstr(path,fullsubdir)) |  | 
| 27 | addpath(fullsubdir) | for id = 1 : size(subdir(:),1) | 
| 28 | end | subdirname = subdir(id).name; | 
| 29 |  | fullsubdir = strcat(packdir,sla,subdirname); | 
| 30 |  | if isempty(findstr(path,fullsubdir)) | 
| 31 |  | addpath(fullsubdir) | 
| 32 |  | end %if | 
| 33 |  | end %for |