In
linear algebra, a
diagonal matrix is a
matrix (usually a
square matrix) in which the entries outside the
main diagonal (↘) are all zero. The diagonal entries themselves may or may not be zero. Thus, the matrix with
n columns and
n rows is diagonal if:
For example, the following matrix is diagonal:
The term
diagonal matrix may sometimes refer to a
rectangular diagonal matrix, which is an
m-by-
n matrix with all the entries not of the form
di,i being zero. For example:
- or