This is a static copy of a profile report

Home

median>meanof (1 call, 0.000 sec)
Generated 14-Nov-2016 07:47:25 using cpu time.
subfunction in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/datafun/median.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
medianfunction1
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
196
c(k) = (a(k)+b(k))/2;
10 s0%
195
k = (sign(a) ~= sign(b)) | isi...
10 s0%
194
c = a + (b-a)/2;
10 s0%
187
if isinteger(a)
10 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 function15
Non-code lines (comments, blank lines)6
Code lines (lines that can run)9
Code lines that did run4
Code lines that did not run5
Coverage (did run/can run)44.44 %
Function listing
time 
calls 
 line
 182 
function c = meanof(a,b)
 183 
% MEANOF the mean of A and B with B > A
 184 
%    MEANOF calculates the mean of A and B. It uses different formula
 185 
%    in order to avoid overflow in floating point arithmetic.
 186 

      1 
 187 
if isinteger(a) 
 188 
    % Swap integers such that ABS(B) > ABS(A), for correct rounding
 189 
    ind = b < 0;
 190 
    temp = a(ind);
 191 
    a(ind) = b(ind);
 192 
    b(ind) = temp;
 193 
end
      1 
 194 
c = a + (b-a)/2; 
      1 
 195 
k = (sign(a) ~= sign(b)) | isinf(a) | isinf(b); 
      1 
 196 
c(k) = (a(k)+b(k))/2; 

Other subfunctions in this file are not included in this listing.