
Last chance! 50% off unlimited learning
Sale ends in
tr
computes the trace of a matrix.
tr(X)
the trace (a scalar)
a (square) matrix
Jan Graffelman (jan.graffelman@upc.edu)
X <- matrix(runif(25),ncol=5)
print(X)
print(tr(X))
Run the code above in your browser using DataLab