Question: Using python , define the following matrices as A and B: (show code used and output please!) A = 4 1 2 3 1 7
Using python, define the following matrices as A and B: (show code used and output please!)
A =
| 4 | 1 | 2 | 3 |
| 1 | 7 | 4 | 0 |
| 3 | 6 | 2 | 1 |
| 9 | 2 | 5 | 4 |
and B =
| 0 | 2 | 3 | 1 |
| 0 | 5 | 0 | 2 |
| 7 | 0 | 4 | 5 |
| 1 | 6 | 0 | 9 |
- Multiply A and B element by element.
- Add A and B element by element.
- Transpose matrix B to B'.
- Extract the third row of matrix A and print it.
- Extract the second column of matrix B and print it.
- Use matrix slicing to define vector a as the last column of matrix A and vector b as the last row of matrix B. Do not simply hard code the numbers of these vectors but use slicing, like you did in the previous questions. Then add up a and b and print the result. (The last question is very important!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
