This is a static copy of a profile reportHome
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)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
200 | f = sprintf('%%%.0f.%.0fg', d+... | 2324 | 0.160 s | 25.0% |  |
206 | scell{i} = sprintf(f,x(i,:)); | 2324 | 0.110 s | 17.2% |  |
205 | for i = 1:m | 2324 | 0.060 s | 9.4% |  |
214 | pads = find(pads); | 2324 | 0.050 s | 7.8% |  |
203 | scell = cell(1,m); | 2324 | 0.050 s | 7.8% |  |
All other lines | | | 0.210 s | 32.8% |  |
Totals | | | 0.641 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 27 |
Non-code lines (comments, blank lines) | 5 |
Code lines (lines that can run) | 22 |
Code lines that did run | 14 |
Code lines that did not run | 8 |
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