# Diagonal Matrix

A square matrix whose non-diagonal elements are zero, is called a diagonal matrix.

Diagonal matrix

Square matrices are appeared with zeros. In a special case, a square matrix contains zero as non-diagonal elements but it contains elements only on principal diagonal. Due to having elements on leading diagonal and having zeros as non-diagonal elements, the square matrix is recognized as a diagonal matrix.

$M$
=

e
1&InvisibleComma;1

0
0

0

0

e
2&InvisibleComma;2

0

0

0
0

e
3&InvisibleComma;3

0

0
0
0

e
m&InvisibleComma;m

The matrix is having elements

${e}_{1⁣1},{e}_{2⁣2},{e}_{3⁣3},\dots {e}_{m⁣m}$

only on principal diagonal but observe the elements on non-diagonal areas. All are zero elements at non-diagonal areas. Therefore, this type of matrix is called a diagonal matrix. The diagonal elements can be either equal or unequal elements.

It is simply expressed as

$M$
= diag

e
1&InvisibleComma;1,

e
2&InvisibleComma;2,

e
3&InvisibleComma;3,

e
n&InvisibleComma;n

## Example

$D$

is a square matrix of order

$5×5$

. It is having

$25$

element in five rows and five columns.

$D$
=

1
0
0
0
0

0
5
0
0
0

0
0
7
0
0

0
0
0
3
0

0
0
0
0
9

The matrix

$D$

is having two types of elements. One type of elements are nonzero elements and remaining all are zeros. Nonzero elements (

$1,–5,7,3$

and

$9$

) are placed on the leading diagonal and remaining non-diagonal elements are zeros. Therefore, the matrix

$D$

is known as a diagonal matrix.

The diagonal matrix

$D$

is written in simple form

$D$
= diag

1,
5,
7,
3,
9