This is a static copy of a profile report

Home

Function details for general/private/parsedirsThis is a static copy of a profile report

Home

general/private/parsedirs (Calls: 12, Time: 0.097 s)
Generated 02-May-2020 21:54:21 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/general/private/parsedirs.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
pathfunction12
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
cdirs = regexprep(cdirs,sprint...
120.060 s61.2%
30
cdirs = regexprep(cdirs, '/{2,...
120.018 s18.6%
19
cdirs = regexp(str, sprintf('[...
120.017 s17.5%
16
fs = filesep;
120.001 s0.8%
33
ix = find(strncmp(cdirs,'~',1)...
120.001 s0.7%
All other lines  0.001 s1.2%
Totals  0.097 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
filesepfunction120.001 s0.5%
pathsepfunction120.000 s0.1%
Self time (built-ins, overhead, etc.)  0.097 s99.4%
Totals  0.097 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function44
Non-code lines (comments, blank lines)29
Code lines (lines that can run)15
Code lines that did run11
Code lines that did not run4
Coverage (did run/can run)73.33 %
Function listing
time 
Calls 
 line
   1 
function cdirs = parsedirs(str,varargin)
   2 
%PARSEDIRS Convert string of directories into a cell array
   3 
%   C = PARSEDIRS(S) converts S, a string of directories separated by path
   4 
%   separators, to C, a cell array of directories. 
   5 
%
   6 
%   The function will clean up each directory name by converting file
   7 
%   separators to the appropriate operating system file separator, and by
   8 
%   ending each cell with a path separator. It will also remove repeated
   9 
%   file and path separators, and insignificant whitespace. 
  10 
%
  11 
%   Example:
  12 
%       cp = parsedirs(path);
  13 

  14 
%   Copyright 1984-2007 The MathWorks, Inc.
  15 

< 0.001 
     12 
  16
fs = filesep; 
< 0.001 
     12 
  17
ps = pathsep; 
  18 

  0.017 
     12 
  19
cdirs = regexp(str, sprintf('[^\\s%s;][^%s;]*', ps, ps), 'match')'; 
  20 

< 0.001 
     12 
  21
if ps == ';' 
  22 
    % Only iron fileseps on PC:
  23 
    cdirs = strrep(cdirs,'/','\');
  24 

  25 
    % Remove repeated "\"s unless they are the start of string
  26 
    % Also ensure a "\" exists after a colon
  27 
	cdirs = regexprep(cdirs, '(:)\s*$|(.)\\{2,}', '$1\');
< 0.001 
     12 
  28
else 
  29 
    % Remove repeated "/"s
  0.018 
     12 
  30
    cdirs = regexprep(cdirs, '/{2,}', '/'); 
  31 

  32 
    % Do any tilde expansion
< 0.001 
     12 
  33
    ix = find(strncmp(cdirs,'~',1)); 
< 0.001 
     12 
  34
    if ~isempty(ix) 
  35 
      cdirs(ix) = unix_tilde_expansion(cdirs(ix));
  36 
    end
< 0.001 
     12 
  37
end 
  38 

  39 
% Remove trailing fileseps, but allow a directory to be "X:\", "\" or "/" 
  40 
% Add pathseps to the end of all paths
  0.060 
     12 
  41
cdirs = regexprep(cdirs,sprintf('(.*[^:])\\%s\\s*$|(.+)\\s*$',fs),sprintf('$1%s', ps)); 
  42 

  43 
% Remove empty paths
< 0.001 
     12 
  44
cdirs(cellfun('isempty', cdirs)) = []; 

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