Skip to content

Tr

Tr(matrix)

computes the trace of the matrix.

See

Examples

>> Tr({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}})
15

Symbolic trace:

>> Tr({{a, b, c}, {d, e, f}, {g, h, i}})
a+e+i

Implementation status

  • ✅ - full supported

Github