https://github.com/cran/pracma
Raw File
Tip revision: 392ae21a013fb3f518e8f9eb8efb458a55a2eca2 authored by HwB on 09 April 2011, 00:00:00 UTC
version 0.3-0
Tip revision: 392ae21
mtrace.Rd
\name{mtrace}
\alias{mtrace}
\title{Matrix trace}
\description{
Sum of the main diagonal elements.
}
\usage{
mtrace(a)
}
\arguments{
  \item{a}{a square matrix}
}
\details{
Sums the elements of the main diagonal of areal or complrx square matrix.
}
\value{
scalar value
}
\note{
The corresponding function in Matlab/Octave is called trace(), but this in \R
has a different meaning.
}
\seealso{
\code{\link{mdiag}}, \code{\link{diag}}
}
\examples{
mtrace(matrix(1:16, nrow=4, ncol=4))
}
\keyword{ array }
back to top