matrix-tr: Trace of a Matrix

Description Usage Arguments Details References Examples

Description

Returns trace of a matrix.

Usage

1
tr(x)

Arguments

x

a numeric matrix.

Details

The function tr computes the trace of a square matrix which is the sum of the diagonal elements of the matrix under consideration.

References

Golub, van Loan, (1996); Matrix Computations, 3rd edition. Johns Hopkins University Press.

Examples

1
2
3
4
5
6
## Create Pascal Matrix:
   P = pascal(3)
   P
  
## Trace:
   tr(P)                                  

fBasics documentation built on Nov. 18, 2017, 4:05 a.m.