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
  1. Multiply A and B element by element.
  2. Add A and B element by element.
  3. Transpose matrix B to B'.
  4. Extract the third row of matrix A and print it.
  5. Extract the second column of matrix B and print it.
  6. 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

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!