This is a static copy of a profile report

Home

num2str>convertUsingRecycledSprintf (2 calls, 0.000 sec)
Generated 05-Aug-2011 13:00:41 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/strfun/num2str.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
num2str>handleNumericPrecisionsubfunction2
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
227
end
20 s0%
226
s = strtrim(s);
20 s0%
218
if ~isempty(pads)
20 s0%
217
pads = find(pads);
20 s0%
215
s = char(scell{:});
20 s0%
All other lines  0 s0%
Totals  0 s0% 
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
201 function s = convertUsingRecycledSprintf(x, d)
2 202 floatFieldExtra = 7;
2 203 f = sprintf('%%%.0f.%.0fg', d+floatFieldExtra, d);
204
2 205 [m, n] = size(x);
2 206 scell = cell(1,m);
2 207 pads = logical([]);
2 208 for i = 1:m
2 209 scell{i} = sprintf(f,x(i,:));
2 210 if n > 1 && (min(x(i,:)) < 0)
211 pads(regexp(scell{i}, '([^\sEe])-')) = true;
212 end
2 213 end
214
2 215 s = char(scell{:});
216
2 217 pads = find(pads);
2 218 if ~isempty(pads)
219 pads = fliplr(pads);
220 spacecol = char(ones(m,1)*' ');
221 for pad = pads
222 s = [s(:,1:pad) spacecol s(:,pad+1:end)];
223 end
224 end
225
2 226 s = strtrim(s);
2 227 end