In
linear algebra
Linear algebra is the branch of mathematics concerning linear equations such as
:a_1x_1+\cdots +a_nx_n=b,
linear maps such as
:(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n,
and their representations in vector spaces and through matrix (mathemat ...
, a diagonal matrix is a
matrix in which the entries outside the
main diagonal are all zero; the term usually refers to
square matrices. Elements of the main diagonal can either be zero or nonzero. An example of a 2×2 diagonal matrix is