\name{tr}


\alias{tr}


\title{Trace of a Matrix}


\description{
    
    Returns trace of a matrix.
    
}


\usage{
tr(x)
}


\arguments{

    \item{x}{
        a numeric matrix.
        }
        
}


\details{
    
    The function \code{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);
    \emph{Matrix Computations}, 
    3rd edition. Johns Hopkins University Press. 
    
}


\examples{
## Create Pascal Matrix:
   P = pascal(3)
   P
  
## Trace:
   tr(P)                                  
}


\keyword{math}

