Simple matrix operations
As mentioned in the introduction to this chapter, the power of matrices is the operations defined on them. Here, we go through some of the basic operations for matrices that we will build on as the book progresses. You have already encountered some of these operations with vectors in the previous chapter, but we will now expand them to matrices.
Addition
Addition is one of the easiest operations, along with its inverse subtraction. You basically just perform addition on each entry of one matrix that corresponds with another entry in the other matrix, as shown in the following formula. Addition is only defined for matrices with the same dimensions:
Example
Here is an example of matrix addition:
Exercise 1
What is the sum of the following two matrices? (Answers to exercises are at the end of the chapter.)
Scalar multiplication
Scalar multiplication is also rather easy. A scalar is just a number, and so scalar multiplication...