CHAPTER 03.03: BINARY OPERATIONS: Subtracting two matrices Theory

 

 

In this segment we will talk about how to subtract two matrices. So, two matrices A and B can be subtracted, if A and B are of the same size. So the first thing in which we have to see is, that if we want to calculate A minus B or B minus A, A and B both have to be the same size. So the number of rows of A have to be the same number as the rows of B. The number of columns of A has to be the same as the number of columns of B. So subtraction will be defined by-take the matrix A and subtract B from it or it can be defined by subtracting A from B. So let’s stick with A minus B. So if we are trying to find A minus B; the number of rows here has to be the same as the number of rows here. The number of columns has to be same as the number of columns here. It will turn out to be the same size as A or B. In order to find out each of the elements the IJ element of C I will take the IJ of A and will subtract from it BIJ. That’s how I will get the element in the C matrix. And that’s the end of this segment.