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