Britannica Sources used in this answer

How are matrices added together?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In linear algebra, two matrices can be added together only if they have the same number of rows and the same number of columns.1

If you have two m×n matrices, A and B, their sum S=A+B is also an m×n matrix. Each element sij of the resulting matrix S is calculated by adding the elements in the corresponding positions of A and B:

sij=aij+bij

In other words, you simply add the value located in the ith row and jth column of matrix A to the value located in the same ith row and jth column of matrix B to find the corresponding element in the new matrix.1