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-2011 The MathWorks, Inc.
|
| | 10 |
|
0.169 | 2809422 | 11 | if ~ismatrix(A) || size(A,1)~=size(A,2)
|
| | 12 | error(message('MATLAB:trace:square'));
|
| | 13 | end
|
3.359 | 2809422 | 14 | t = full(sum(diag(A)));
|
Other subfunctions in this file are not included in this listing.