Question: Write a function called GenMat that takes a 2 D array of numbers inMat and produces an array called outMat. The function copies the input
Write a function called GenMat that takes a D array of numbers inMat and produces an array called outMat. The function copies the input array inMat to the output variable outMat and then performs the following operations on outMat in order:
Delete the first and last columns. Store the information from these columns in variables to be used later.
Sum the elements of the first row in inMat and place the answer in the last row all entries of outMat ie overwrite any existing values
Sum of elements of the last row in inMat and place the answer in the first row all entires of outMat ie overwrite any existing values
Append the sum of the two deleted columns from part as the new last column of outMat.
Append the product of the two deleted columns from part as the new first column of outMat.
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
