CHAPTER 03.04: BINARY OPERATIONS:
Subtracting two matrices Example In
this segment we will talk about how to subtract two matrices. We will take an
example of it. So let’s suppose somebody says, hey, find A minus B if A is
given to you as this particular matrix, let’s suppose. 3, 6, 7, 9, 2.1 and 3.
And B matrix is given to you as 2, -5, 6, 7, -7, and 3. So the first thing
you have to understand is that, if we are subtracting two matrices, the two
matrices have to be of the same order. We are seeing here that this
particular matrix is two rows and 3 columns and this one is also 2 rows and 3
columns. The size is the same, so we can indeed subtract the 2 matrices. That’s
the first thing we should check. Now let’s go and see what the initial
elements are of the A minus B matrix. So since we have two rows and three
columns we’ll basically have 6 elements in our 2 by 3 matrix. This is
resulting from B from A. So
the element I - have to do, that means that I have to find out the first row
and first column here. I will take the first row first column here and
subtract the first row and first column here. Three minus 2. This will give
me a one. I take the first row, second column here and the first row, second
column here: 6 minus 5 is 11. So I put 11 here. Same here, I have a first
row, 3rd column of 7 here, first row 3rd column here of 6 here. So 7 minus 6
is 1. The other ones will be 2, 9.1, and 0. And that is what the resulting C
matrix is when you are subtracting A matrix-B matrix from the A matrix or A
minus B as it’s called. And that is the end of this segment. |