dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day! You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? Contact-me!

This page is using the new English version of dCode, please make comments !

Tool to compute the trace of a matrix. The trace of a square matrix M is the sum of its main diagonal denoted Tr(M).

Answers to Questions

How to calculate a matrix trace?

For a square matrix M of size n, you make the sum of diagonal values:$$ \mathrm{Tr}(M) = \sum_{i=1}^{n} a_{i \, i} $$For rectangular matrix, the diagonal used is the one of the included square matrix.

For a 2x2 matrix : $$ M = \begin{pmatrix} a & b \\ c & d \end{pmatrix} $$

$$ {\rm Tr}(M) = a+d $$

For a 3x3 matrix : $$ M = \begin{pmatrix} a & b & c \\d & e & f \\ g & h & i \end{pmatrix} $$

$$ {\rm Tr}(M) = a+e+i $$

What are trace mathematical properties?

Trace follows the following properties :

For A and B of the same order (that can be added):

dCode retains ownership of the source code of the script Trace of a Matrix. Except explicit open source licence (free / freeware), any algorithm, applet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any snippet or function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in PHP (or Java, C#, Python, Javascript, etc.) which dCode owns rights can be transferred after sales quote. So if you need to download the Trace of a Matrix script for offline use, for you, your company or association, see you on contact page !

dCode uses cookies to customize the site content, analyze user behavior and adapt dCode to your use. Some data is stored and collected for advertising purposes and may be shared with our partners. OK