trace
Trace of a matrix.
t=trace(a)
Inputs
a Any matrix.
Outputs
t The trace of a , i.e., the sum of the diagonal elements of a .


Example
>>a=[1 2 3 4; 5 6 7 8; 9 10 11 12;13 14 15 16]
>>a
          1          2          3          4
          5          6          7          8
          9         10         11         12
         13         14         15         16

>>trace(a)
34