Linear Algebra/Diagonal Matrix

A diagonal matrix, $$A$$, is a square matrix in which the entries outside of the main diagonal are zero. The main diagonal of a square matrix consists of the entries which run from the top left corner to the bottom right corner.

In the example below the main diagonal are $$a_{11}, a_{22}, ..., a_{nn}\!$$
 * $$ \quad A=\begin{bmatrix}a_{11} & 0 & \cdots & 0 \\ 0 & a_{22} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{nn}\end{bmatrix}$$