Trace of a matrix
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
linalg::tr(A) returns the trace of the square
i.e., the sum of the diagonal elements of A.
We compute the trace of the following matrix:
A := Dom::Matrix(Dom::Integer) (3, 3, (i, j) -> 3*(i - 1) + j)
A square matrix of a domain of category
Element of the component ring of