This is a static copy of a profile report

Home

num2str>convertUsingRecycledSprintf (152 calls, 0.020 sec)
Generated 14-Nov-2016 07:47:08 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/strfun/num2str.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
195
f = sprintf('%%%.0f.%.0fg', d+...
1520.010 s50.0%
194
floatFieldExtra = 7;
1520.010 s50.0%
219
end
1520 s0%
218
s = strtrim(s);
1520 s0%
210
if ~isempty(pads)
1520 s0%
All other lines  0 s0%
Totals  0.020 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
 193 
function s = convertUsingRecycledSprintf(x, d)
  0.01 
    152 
 194 
    floatFieldExtra = 7; 
  0.01 
    152 
 195 
    f = sprintf('%%%.0f.%.0fg', d+floatFieldExtra, d); 
 196 
    
    152 
 197 
    [m, n] = size(x); 
    152 
 198 
    scell = cell(1,m); 
    152 
 199 
    pads = logical([]); 
    152 
 200 
    for i = 1:m 
    152 
 201 
        scell{i} =  sprintf(f,x(i,:)); 
    152 
 202 
        if n > 1 && (min(x(i,:)) < 0) 
 203 
            pads(regexp(scell{i}, '([^\sEe])-')) = true;
 204 
        end
    152 
 205 
    end 
 206 

    152 
 207 
    s = char(scell{:}); 
 208 

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