- Random Topics
- Random Topics
- Matrix Multiplication
- Leap Year Formula Explained
- Matrix Addition
- Matrix Subtraction
- Celsius to Fahrenheit
- Find LCM
- Find HCF
- Pascal's Triangle
- Area Perimeter of Triangle
- Programming Examples
- Python Program Examples
- Java Programming Examples
- C++ Programming Examples
- C Programming Examples
- Give Online Test
- All Test List
- Java Test
- C Test
- C++ Test
- HTML Test
- CSS Test
- JavaScript Test
- SQL Test
- Computer Fundamental Test
- Operating System Test
- Networking Test
- MySQL Test

# Matrix Multiplication Rules & Formula

In this tutorial, you will learn all about matrix multiplication. Here I've shown steps involed in matrix multiplication through pictorial representation. And I think pictorial representation is the best things to define any little complecated topics. Therefore, here is the two topics you are going to aware about:

- What the Matrix is ?
- How the multiplication of two matrix performs ?

I'll explain these two topics, in the term that can be understandable for any programmer over here.

### What is Matrix ?

In Programming world, matrix is basically a two-dimensional (2D) array. Here two dimension means, the element of array arranged in two dimensions that are rows and columns. Rows are from top-to-bottom, whereas columns are from left-to-right. For example,

As you can see from the above matrix, there are total of **m** numbers or rows and **n** numbers of columns.
And **A _{11}, A_{12}, ....., A_{mn}** are the elements of matrix, arranged in a way, that
the element

- A
_{11}is at 1^{st}row, 1^{st}column - A
_{12}is at 1^{st}row, 2^{nd}column - A
_{1n}is at 1^{st}row, n^{th}column - A
_{21}is at 2^{nd}row, 1^{st}column - A
_{22}is at 2^{nd}row, 2^{nd}column - A
_{2n}is at 2^{nd}row, n^{th}column - A
_{m1}is at m^{th}row, 1^{st}column - A
_{m2}is at m^{th}row, 2^{nd}column - A
_{mn}is at m^{th}row, n^{th}column

## How Matrix Multiplication Performs ?

To multiply any two matrices, we need to do the **dot product** of rows and columns. Before going to the
step-by-step process of matrix multiplication. Let's first understand about matrix **dot product**. So to do the
dot product of **(1,2,3).(4,5,6)**. Here are the steps:

(1,2,3).(4,5,6) =(1x4)+(2x5)+(3x6) =4+10+18 =32

Now let's understand about matrix multiplication using the step by step process given below.

## Step by Step Process of Matrix Multiplication

Here are the step by step process to multiply the two given matrix:

In first step, perform the dot product of first row's elements (of first matrix) to first column's elements (of second matrix) as shown below:

In second step, perform the dot product of first row's elements (of first matrix) to second column's elements (of second matrix) as shown below:

In third step, perform the dot product of second row's elements (of first matrix) to first column's elements (of second matrix) as shown below:

In fourth step, perform the dot product of second row's elements (of first matrix) to second column's elements (of second matrix) as shown below:

In this way, you can perform matrix multiplication.

## Condition for Matrix Multiplication to be Perform

In order for matrix multiplication to be perform or defined, the number of columns in first matrix must be equal to the number of rows in second matrix.

#### Programs Made on This

- Matrix Multiplication in C
- Matrix Multiplication in C++
- Matrix Multiplication in Java
- Matrix Multiplication in Python

« Previous Tutorial Next Tutorial »