The trace of a square matrix is the sum of the diagonal elements. The trace command finds the trace of a matrix.