This is a static copy of a profile report

Home

num2str>convertUsingRecycledSprintf (20 calls, 0.000 sec)
Generated 04-Aug-2014 13:05:19 using cpu time.
subfunction in file /share/apps/matlabr2014a/toolbox/matlab/strfun/num2str.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
217
end
200 s0%
216
s = strtrim(s);
200 s0%
208
if ~isempty(pads)
200 s0%
207
pads = find(pads);
200 s0%
205
s = char(scell{:});
200 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
 191 
function s = convertUsingRecycledSprintf(x, d)
     20 
 192 
    floatFieldExtra = 7; 
     20 
 193 
    f = sprintf('%%%.0f.%.0fg', d+floatFieldExtra, d); 
 194 
    
     20 
 195 
    [m, n] = size(x); 
     20 
 196 
    scell = cell(1,m); 
     20 
 197 
    pads = logical([]); 
     20 
 198 
    for i = 1:m 
     20 
 199 
        scell{i} =  sprintf(f,x(i,:)); 
     20 
 200 
        if n > 1 && (min(x(i,:)) < 0) 
 201 
            pads(regexp(scell{i}, '([^\sEe])-')) = true;
 202 
        end
     20 
 203 
    end 
 204 

     20 
 205 
    s = char(scell{:}); 
 206 

     20 
 207 
    pads = find(pads); 
     20 
 208 
    if ~isempty(pads) 
 209 
        pads = fliplr(pads);
 210 
        spacecol = char(ones(m,1)*' ');
 211 
        for pad = pads
 212 
            s = [s(:,1:pad) spacecol s(:,pad+1:end)];
 213 
        end
 214 
    end
 215 
    
     20 
 216 
    s = strtrim(s); 
     20 
 217 
end