Question: Using python , define the following matrices as A and B A= 4 1 2 3 1 7 4 0 3 6 2 1 9
Using python, define the following matrices as A and B
A=
| 4 | 1 | 2 | 3 |
| 1 | 7 | 4 | 0 |
| 3 | 6 | 2 | 1 |
| 9 | 2 | 5 | 4 |
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.
(Please include code and output!)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
