This is a static copy of a profile report

Home

addpath (2 calls, 0.111 sec)
Generated 14-Nov-2016 07:47:09 using cpu time.
function in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/general/addpath.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
LOH_hapmap_v4function1
allelic_ratios_WGseqfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
86
path(p, mp);
20.101 s90.9%
63
p = catdirs(varargin{1:n});
20.010 s9.1%
87
end    
20 s0%
85
else
20 s0%
83
if append
20 s0%
All other lines  0.000 s0.0%
Totals  0.111 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathfunction20.101 s90.9%
general/private/catdirsfunction20.010 s9.1%
Self time (built-ins, overhead, etc.)  0.000 s0.0%
Totals  0.111 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function87
Non-code lines (comments, blank lines)47
Code lines (lines that can run)40
Code lines that did run16
Code lines that did not run24
Coverage (did run/can run)40.00 %
Function listing
time 
calls 
 line
   1 
function oldpath = addpath(varargin)
   2 
%ADDPATH Add directory to search path.
   3 
%   ADDPATH DIRNAME prepends the specified directory to the current
   4 
%   matlabpath.  Surround the DIRNAME in quotes if the name contains a
   5 
%   space.  If DIRNAME is a set of multiple directories separated by path
   6 
%   separators, then each of the specified directories will be added.
   7 
%
   8 
%   ADDPATH DIR1 DIR2 DIR3 ...  prepends all the specified directories to
   9 
%   the path.
  10 
%
  11 
%   ADDPATH ... -END    appends the specified directories.
  12 
%   ADDPATH ... -BEGIN  prepends the specified directories.
  13 
%   ADDPATH ... -FROZEN disables directory change detection for directories
  14 
%                       being added and thereby conserves Windows change
  15 
%                       notification resources (Windows only).
  16 
%
  17 
%   Use the functional form of ADDPATH, such as ADDPATH('dir1','dir2',...),
  18 
%   when the directory specification is stored in a string.
  19 
%
  20 
%   P = ADDPATH(...) returns the path prior to adding the specified paths.
  21 
%
  22 
%   Examples
  23 
%       addpath c:\matlab\work
  24 
%       addpath /home/user/matlab
  25 
%       addpath /home/user/matlab:/home/user/matlab/test:
  26 
%       addpath /home/user/matlab /home/user/matlab/test
  27 
%
  28 
%   See also RMPATH, PATHTOOL, PATH, SAVEPATH, USERPATH, GENPATH, REHASH.
  29 

  30 
%   Copyright 1984-2014 The MathWorks, Inc.
  31 

  32 
% Number of  input arguments
      2 
  33 
n = nargin; 
      2 
  34 
narginchk(1,Inf); 
  35 

      2 
  36 
if nargout>0 
  37 
    oldpath = path;
  38 
end
  39 

      2 
  40 
append = -1; 
      2 
  41 
freeze = 0; 
      2 
  42 
args = varargin; 
  43 

      2 
  44 
while (n > 1)    
  45 
    last = args{n};
  46 
    % Append or prepend to the existing path
  47 
    if isequal(last,1) || strcmpi(last,'-end')
  48 
        if (append < 0), append = 1; end; 
  49 
        n = n - 1;
  50 
    elseif isequal(last,0) || strcmpi(last,'-begin')
  51 
        if (append < 0), append = 0; end;
  52 
        n = n - 1;
  53 
    elseif strcmpi(last,'-frozen') 
  54 
        if ispc, freeze = 1; end
  55 
        n = n - 1;
  56 
    else
  57 
        break;
  58 
    end
  59 
end
      2 
  60 
if (append < 0), append = 0; end 
  61 

  62 
% Check, trim, and concatenate the input strings
  0.01 
      2 
  63 
p = catdirs(varargin{1:n}); 
  64 

  65 
% If p is empty then return
      2 
  66 
if isempty(p) 
  67 
    return;
  68 
end
  69 

  70 
% See whether frozen is desired, where the state is not already set frozen
      2 
  71 
if freeze 
  72 
    oldfreeze = system_dependent('DirsAddedFreeze');
  73 
    % Check whether old unfrozen state needs to be restored
  74 
    if ~isempty(strfind(oldfreeze,'unfrozen'))
  75 
        %Use the onCleanup object to automatically restore old state at
  76 
        %exit or error.
  77 
        cleanUp = onCleanup(@()system_dependent('DirsAddedUnfreeze'));
  78 
    end
  79 
end
  80 

  81 
% Append or prepend the new path
      2 
  82 
mp = matlabpath; 
      2 
  83 
if append 
  84 
    path(mp, p);
      2 
  85 
else 
  0.10 
      2 
  86 
    path(p, mp); 
      2 
  87 
end     

Other subfunctions in this file are not included in this listing.