This is a static copy of a profile report

Home

trace (2 calls, 0.000 sec)
Generated 28-Feb-2011 19:13:52 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/toolbox/matlab/matfun/trace.m
Copy to new window for comparing multiple runs

Parents (calling functions)
No parent
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
15
t = sum(diag(A));
20 s0%
12
if ~(ndims(A)==2 && si...
20 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)
No children
M-Lint results
No M-Lint messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function15
Non-code lines (comments, blank lines)11
Code lines (lines that can run)4
Code lines that did run2
Code lines that did not run2
Coverage (did run/can run)50.00 %
Function listing
   time   calls  line
1 function t = trace(A)
2 %TRACE Sum of diagonal elements.
3 % TRACE(A) is the sum of the diagonal elements of A, which is
4 % also the sum of the eigenvalues of A.
5 %
6 % Class support for input A:
7 % float: double, single
8
9 % Copyright 1984-2007 The MathWorks, Inc.
10 % $Revision: 5.8.4.2 $ $Date: 2007/11/01 12:38:53 $
11
2 12 if ~(ndims(A)==2 && size(A,1)==size(A,2))
13 error('MATLAB:square','Matrix must be square.');
14 end
2 15 t = sum(diag(A));