powered by
Trace(a)
Diag
diag
Trace(matrix(1:16, nrow=4, ncol=4))
Run the code above in your browser using DataLab