powered by
tr(X)
diag(X)
X <- matrix(1:9, 3, 3) tr(X)
Run the code above in your browser using DataLab