Module 6 Assignment
First, two small matrices are created and used to practice matrix addition and subtraction . These operations combine values based on their position in the matrix. Addition adds corresponding elements, while subtraction finds the difference between elements in the same row and column positions. This demonstrates how matrix arithmetic works element by element. Since we are creating a matrices using the matrix() function, R will fill the matrices by column. The matrices will look like this: By combining all the corresponding numbers to each column by adding, you will get the value of what it equals to in each spot. Matrix addition adds corresponding positions: 2 + 5 = 7 1 + 4 = 5 0 + 2 = 2 3 + (-1) = 2 Here we are doing the same thing to the matrix. Only this time we are subtracting the values in each box. Matrix subtraction subtracts corresponding elements: 2 - 5 = -3 1 - 4 = -3 0 - 2 = -2 3 - (-1) = 4 Next, the assignment uses the diag() function to build a diagonal matrix...