This is a static copy of a profile report

Home

num2str>convertUsingRecycledSprintf (2324 calls, 0.641 sec)
Generated 05-Nov-2014 07:52:34 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/strfun/num2str.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
num2str>handleNumericPrecisionsubfunction2324
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
200
f = sprintf('%%%.0f.%.0fg', d+...
23240.160 s25.0%
206
scell{i} =  sprintf(f,x(i,:));
23240.110 s17.2%
205
for i = 1:m
23240.060 s9.4%
214
pads = find(pads);
23240.050 s7.8%
203
scell = cell(1,m);
23240.050 s7.8%
All other lines  0.210 s32.8%
Totals  0.641 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function27
Non-code lines (comments, blank lines)5
Code lines (lines that can run)22
Code lines that did run14
Code lines that did not run8
Coverage (did run/can run)63.64 %
Function listing
   time   calls  line
198 function s = convertUsingRecycledSprintf(x, d)
0.01 2324 199 floatFieldExtra = 7;
0.16 2324 200 f = sprintf('%%%.0f.%.0fg', d+floatFieldExtra, d);
201
0.01 2324 202 [m, n] = size(x);
0.05 2324 203 scell = cell(1,m);
2324 204 pads = logical([]);
0.06 2324 205 for i = 1:m
0.11 2324 206 scell{i} = sprintf(f,x(i,:));
0.01 2324 207 if n > 1 && (min(x(i,:)) < 0)
208 pads(regexp(scell{i}, '([^\sEe])-')) = true;
209 end
0.03 2324 210 end
211
0.02 2324 212 s = char(scell{:});
213
0.05 2324 214 pads = find(pads);
0.02 2324 215 if ~isempty(pads)
216 pads = fliplr(pads);
217 spacecol = char(ones(m,1)*' ');
218 for pad = pads
219 s = [s(:,1:pad) spacecol s(:,pad+1:end)];
220 end
221 end
222
0.04 2324 223 s = strtrim(s);
0.02 2324 224 end