Question: C++ Workout 1) Matrix Multiplication Matrix multiplication involves quite a few math operations. Write a function to do this for you that takes in four

C++ C++ Workout 1) Matrix Multiplication Matrix multiplication involves quite a few math

Workout 1) Matrix Multiplication Matrix multiplication involves quite a few math operations. Write a function to do this for you that takes in four inputs: matrix A, matrix B, an output matrix and a size (again assume square matrices). For this problem assume the size is always 3 (so 3x3 matrices). Ask the user to input both matrices A and B. then display the output matrix. Assume it is always A*B with matrix A on the left (the first input matrix) To do matrix multiplication, any given output "spot" is computed using the whole row of at the spot" and the whole column of B at the spot" The first number in the row is multiplied by the first number in the col- umn, then the second number in the row is multiplied with the second number in the column, and so on. All these values are added together to get the final value for the "spot". For example, the top middle "spot" in the output is shown in the example below 1 2 3 [10 11 12 4 5 6 13 14 15 - ? ? 16 17 18 7 8 9 This is computed as 1911214170 If you are still uncertain how matrix multiplication works, here are a few links for ask a TA): https://www.mathsisfun.com algebra matrix multiplying.html https://en.wikipedia.org/wiki/Matris_multiplication Example Input first matrix 1 2 3 7 8 9 Input second matrix 10 11 12 13 14 15 16 17 18 Output matrix 84 90 96 201 216 231 318 342 365

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!