A matrix is a rectangular array of different numbers. we can do different operations like addition, multiplication or subtraction.

Matrix size is the number of rows and columns of matrix. the matrix with (m rows) and (n columns) is called m × n. the m & n are calles its dimensions. for example if matrix (A) has 4 rows and 3 columns. we said A is 4 × 3 matrix

The sum A+B of two m-by-n matrices A and B is calculated entrywise:

- (
**A**+**B**)_{i,j}=**A**_{i,j}+**B**_{i,j}, where 1 ≤*i*≤*m*and 1 ≤*j*≤*n*.

To add two matrices, it is required that the number of rows in the first matrix be equal to the number of rows in the second matrix and the number of columns in the first matrix equals the number of columns in the second matrix.

The product cA of a number c and a matrix A is computed by multiplying every entry of A by c:

- (
*c***A**)_{i,j}=*c*·**A**_{i,j}.

The transpose of an m-by-n matrix A is the n-by-m matrix AT (also denoted Atr or tA) formed by turning rows into columns and vice versa:

- (
**A**^{T})_{i,j}=**A**_{j,i}.

The condition same as in matrix addition. it is required that the number of rows in the first matrix be equal to the number of rows in the second matrix and the number of columns in the first matrix equals the number of columns in the second matrix.

To multiply two matrices, the number of columns in the first matrix must be equal to the number of rows in the second matrix.