Menu

[Solved] Objective Write Function Named Matrix Mul B Given Two 2d Array Matrix B Function Returns Q37226193

Objective: Write a function named matrix mul(a, b). Given a two 2D array(Matrix) A and B, the function returns the product of

You should write your code in function: def matrix mul(A,B) # return an array Task 1: You use three level nested for loop(do

please help!

Objective: Write a function named matrix mul(a, b). Given a two 2D array(Matrix) A and B, the function returns the product of A and B A 1[1,2,31,4,5,6]] B [I1,21,13,41,[5,6]] Description: The product C of two matrices A and B is defined as where is summed over for all possible values of and k. In order for matrix multiplication to be defined, the dimensions of the matrices must satisfy where (axb) denotes a matrix with a rows and b columns. Writing out the product explicitly where €11 #@jlbu +al2 bn + + al m h.1 (10) You should write your code in function: def matrix mul(A,B) # return an array Task 1: You use three level nested for loop(do not use numpy.dot0). Taks 2: use numpy.dot0 function to compute the matrix multiplication.https:/ldocs.scip Example Dialog: A np.array ([[1, 2, 3], [4, 5, 6]]) B np.array(II1, 2], [3, 4], [5, 6]]) print (matrix mul(A, B)) A np.array ([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 1211) B np.array(II1, 2, 9], [3, 4, 10], [5, 6, 11], [7, 8, 12]]) print (matrix mul(A, B)) The result is: II22.28.] 149.64. IIso. 60.11o] 14.140.278] [178. 220. 446.11 Show transcribed image text Objective: Write a function named matrix mul(a, b). Given a two 2D array(Matrix) A and B, the function returns the product of A and B A 1[1,2,31,4,5,6]] B [I1,21,13,41,[5,6]] Description: The product C of two matrices A and B is defined as where is summed over for all possible values of and k. In order for matrix multiplication to be defined, the dimensions of the matrices must satisfy where (axb) denotes a matrix with a rows and b columns. Writing out the product explicitly where €11 #@jlbu +al2 bn + + al m h.1 (10)
You should write your code in function: def matrix mul(A,B) # return an array Task 1: You use three level nested for loop(do not use numpy.dot0). Taks 2: use numpy.dot0 function to compute the matrix multiplication.https:/ldocs.scip Example Dialog: A np.array ([[1, 2, 3], [4, 5, 6]]) B np.array(II1, 2], [3, 4], [5, 6]]) print (matrix mul(A, B)) A np.array ([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 1211) B np.array(II1, 2, 9], [3, 4, 10], [5, 6, 11], [7, 8, 12]]) print (matrix mul(A, B)) The result is: II22.28.] 149.64. IIso. 60.11o] 14.140.278] [178. 220. 446.11

Expert Answer


Answer to Objective: Write a function named matrix mul(a, b). Given a two 2D array(Matrix) A and B, the function returns the produ… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *