This is a static copy of a profile report

Home

ls>quoteUnixCmdArg (20 calls, 0.030 sec)
Generated 05-Nov-2014 07:52:33 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/general/ls.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
lsfunction20
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
89
quotedArgs = strcat(' ''', quo...
200.020 s66.7%
90
quotedArgs = [quotedArgs{:}];
200 s0%
87
quotedArgs= regexprep(quotedAr...
200 s0%
84
quotedArgs= regexprep(tildeArg...
200 s0%
79
if ~isempty(ix) 
200 s0%
All other lines  0.010 s33.3%
Totals  0.030 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cell.strcatfunction200.020 s66.7%
Self time (built-ins, overhead, etc.)  0.010 s33.3%
Totals  0.030 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function23
Non-code lines (comments, blank lines)14
Code lines (lines that can run)9
Code lines that did run7
Code lines that did not run2
Coverage (did run/can run)77.78 %
Function listing
   time   calls  line
68 function quotedArgs = quoteUnixCmdArg(varargin)
69 % Algorithm: Start and end each argument with a single quote (squote).
70 % Within each argument:
71 % 1. squote -> squote '\' squote squote
72 % 2. '!' -> squote '\' '!' squote
73 % 3. '*' -> squote '*' squote (MATLAB globbing character)
74 %
75
76 % Do any tilde expansion first
20 77 tildeArgs = varargin;
20 78 ix = find(strncmp(tildeArgs,'~',1));
20 79 if ~isempty(ix)
80 tildeArgs(ix) = unix_tilde_expansion(tildeArgs(ix));
81 end
82
83 % Special cases to maintain as literal: single quote or ! with '\thing_I_found'
20 84 quotedArgs= regexprep(tildeArgs,'[''!]','''\\$&''');
85
86 % Special cases to maintain as NOT literal: Replace * with 'thing_I_found'
20 87 quotedArgs= regexprep(quotedArgs,'[*]','''$&''');
88
0.02 20 89 quotedArgs = strcat(' ''', quotedArgs, '''');
20 90 quotedArgs = [quotedArgs{:}];