Question: Write a function called flatten _ slice _ and _ multiply that has two inputs called Matrix 1 and Matrix 2 where each is represented
Write a function called flattensliceandmultiply that has two inputs called Matrix and Matrix where each is represented as a numpy array. The function should reshape Matrix so that it is a vector ie its shape is in the form x then it should slice Matrixby removing the last z columns so that the product of the sliced Matrix and the reshaped Matrix is possible, and finally return the product. For this question, the number of elements in the reshaped Matrix will always be less than or equal to the number of columns in initial Matrix
For example, if the shape of Matrix were and the shape of Matrix were then the shape of the reshaped Matrix would be and the shape of the sliced Matrix would be
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
