powered by
Sum of diagonal elements of a matrix.
tr(x)
The sum of the diagonal elements of x.
x
A matrix.
tr(ones(5, 10)) x <- replicate(1000, tr(rand(25, 25))) hist(x)
Run the code above in your browser using DataLab