Trace of the input square matrix: Sum of all the diagonal elements of a square matrix.
tr(A)
A
Input square matrix or scalar
Can be used with a character matrix.
trace of A
tr(demomat(2,2))