- `T = trace (A)`

Compute the trace of `A`, the sum of the elements along the main diagonal.

The implementation is straightforward: `sum (diag (A))`.

See also: `eig`.

### References

- https://www.mathworks.com/help/matlab/ref/double.trace.html
- https://octave.sourceforge.io/octave/function/trace.html
- https://mathworld.wolfram.com/MatrixTrace.html
- https://en.wikipedia.org/wiki/Trace_(linear_algebra)
