This is a static copy of a profile report

Home

mean (12118 calls, 0.931 sec)
Generated 05-Nov-2014 07:53:52 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/datafun/mean.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ml_parsecell>updates2subfunction6058
ml_bwmomentfunction6058
ml_estpdffunction1
eff_PCAfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
30
y = sum(x,dim)/size(x,dim);
121170.561 s60.2%
31
end
121170.130 s14.0%
23
if nargin==1, 
121180.050 s5.4%
29
else
121170.040 s4.3%
28
y = sum(x)/size(x,dim);
10 s0%
All other lines  0.150 s16.1%
Totals  0.931 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function31
Non-code lines (comments, blank lines)24
Code lines (lines that can run)7
Code lines that did run7
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function y = mean(x,dim)
2 %MEAN Average or mean value.
3 % For vectors, MEAN(X) is the mean value of the elements in X. For
4 % matrices, MEAN(X) is a row vector containing the mean value of
5 % each column. For N-D arrays, MEAN(X) is the mean value of the
6 % elements along the first non-singleton dimension of X.
7 %
8 % MEAN(X,DIM) takes the mean along the dimension DIM of X.
9 %
10 % Example: If X = [1 2 3; 3 3 6; 4 6 8; 4 7 7];
11 %
12 % then mean(X,1) is [3.0000 4.5000 6.0000] and
13 % mean(X,2) is [2.0000 4.0000 6.0000 6.0000].'
14 %
15 % Class support for input X:
16 % float: double, single
17 %
18 % See also MEDIAN, STD, MIN, MAX, VAR, COV, MODE.
19
20 % Copyright 1984-2009 The MathWorks, Inc.
21 % $Revision: 5.17.4.5 $ $Date: 2010/09/02 13:35:22 $
22
0.05 12118 23 if nargin==1,
24 % Determine which dimension SUM will use
1 25 dim = find(size(x)~=1, 1 );
1 26 if isempty(dim), dim = 1; end
27
1 28 y = sum(x)/size(x,dim);
0.04 12117 29 else
0.56 12117 30 y = sum(x,dim)/size(x,dim);
0.13 12117 31 end