A rectangular array of data arranged in the form of rows and columns is termed a matrix. The rows are the horizontal arrangement of data, while the columns are the vertical arrangement of items. The data inside a matrix can be real or a complex number (belonging to an imaginary number).
A matrix is of the order a x b, where a represents the number of rows and b depicts the number of columns in a matrix. Such an array is enclosed by square brackets  or parenthesis (). There are numerous matrices present in the mathematical world, such as Singleton matrix, Zero matrix, Vertical and Horizontal matrix, Triangular matrix, Nilpotent matrix, Diagonal matrix, and more. In this section, you will dive into the depths of the concepts and operations related to the study of a diagonal matrix, its definition, and the properties of a diagonal matrix.
A diagonal matrix is defined as any square matrix in which all elements are zero except those that appear diagonally. Assume that a square matrix [Amn]a x b can be considered a diagonal matrix if and only if Amn= 0. This also implies that any element belonging to the address where m=n is not equal to zero.
Let us now look into the main properties of a diagonal matrix. There are a total of 3 properties associated with any diagonal matrix; they are mentioned below:
Property 1: Two diagonal matrices can be summed or multiplied if and only if they are of identical order.
For example: 2 0 0 9 + 6 0 0 1 = 2+6 0+0 0+0 9+1 =8 0 0 10
The resultant matrix is also a diagonal matrix.
Property 2: When a diagonal matrix is transposed (interchange of rows and columns), then the resultant matrix is the same because the diagram elements are zero. Let us consider a matrix K as a diagonal matrix, then K = K’.
For example: 4 0 0 13 = 4 0 0 13
Property 3: Diagonal Matrices are commutative, which means that if two diagonal matrices, say K and L, are multiplied, the resultant matrix is equal to the product of L and K. This property can be expressed as K x L = L x K
For example: Let K = 5 0 0 9 and L = 3 0 0 7
Therefore, K x L = 5 0 0 9 x 3 0 0 7 = 5 x 3 0 0 9 x 7 = 15 0 0 63
Now, L x K = 3 0 0 7 x 5 0 0 9 = 3 x 5 0 0 7 x 9 = 15 0 0 63
A block matrix is a matrix that has been divided into blocks. Off-diagonal blocks in this form of a square matrix are zero matrices, whereas main diagonal blocks are square matrices. The non-diagonal blocks are 0 in this case. When Bmn = 0 and ‘m’ is not equal to ‘n’, B is referred to as a block diagonal matrix.
A matrix is said to be an anti-diagonal matrix if the elements on the diagonal are the only numbers; whereas, the rest are zero. This is the diagonal that stretches from the upper right corner to the lower-left corner.
An example of an anti-diagonal matrix is:
K = 0 0 2 0 5 0 6 0 0