Diagonal matrix. A diagonal matrix is a special kind of symmetric matrix. It is a symmetric matrix with zeros in the off-diagonal elements. Two diagonal matrices are shown below.
A =
1 0
0 3
B =
5 0 0
0 3 0
0 0 1
Note that the diagonal of a matrix refers to the elements that run from the upper left corner to the lower right corner.