This is a static copy of a profile report

Home

num2str>convertUsingRecycledSprintf (Calls: 58, Time: 0.010 s)
Generated 16-Jul-2020 17:09:45 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/strfun/num2str.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
206
f = sprintf('%%%.0f.%.0fg', d+...
580.003 s34.3%
212
scell{i} =  sprintf(f,x(i,:));
580.002 s16.3%
229
s = strtrim(s);
580.001 s7.4%
220
pads = find(pads);
580.001 s5.3%
211
for i = 1:m
580.000 s4.9%
All other lines  0.003 s31.8%
Totals  0.010 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
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 run16
Code lines that did not run6
Coverage (did run/can run)72.73 %
Function listing
time 
Calls 
 line
 204 
function s = convertUsingRecycledSprintf(x, d)
< 0.001 
     58 
 205
    floatFieldExtra = 7; 
  0.003 
     58 
 206
    f = sprintf('%%%.0f.%.0fg', d+floatFieldExtra, d); 
 207 
    
< 0.001 
     58 
 208
    [m, n] = size(x); 
< 0.001 
     58 
 209
    scell = cell(1,m); 
< 0.001 
     58 
 210
    pads = logical([]); 
< 0.001 
     58 
 211
    for i = 1:m 
  0.002 
     58 
 212
        scell{i} =  sprintf(f,x(i,:)); 
< 0.001 
     58 
 213
        if n > 1 && (min(x(i,:)) < 0) 
 214 
            pads(regexp(scell{i}, '([^\sEe])-')) = true;
< 0.001 
     58 
 215
        end 
< 0.001 
     58 
 216
    end 
 217 

< 0.001 
     58 
 218
    s = char(scell{:}); 
 219 

< 0.001 
     58 
 220
    pads = find(pads); 
< 0.001 
     58 
 221
    if ~isempty(pads) 
 222 
        pads = fliplr(pads);
 223 
        spacecol = char(ones(m,1)*' ');
 224 
        for pad = pads
 225 
            s = [s(:,1:pad) spacecol s(:,pad+1:end)];
 226 
        end
< 0.001 
     58 
 227
    end 
 228 
    
< 0.001 
     58 
 229
    s = strtrim(s); 
< 0.001 
     58 
 230
end