Question: in Matlab. Write a function which takes in 2 4x4 matrices M and N and returns the sum of the diagonal of the resulting matrix
in Matlab.

Write a function which takes in 2 4x4 matrices M and N and returns the sum of the diagonal of the resulting matrix from this computation M^2 * N. hint: use both the built-in functions diag and sum. Test the function using the following two matrices: M = [1 2 3 4; 5 6 7 8; 9 10 11 12; 1 2 3 4] N = [2 4 6 8; 2 4 6 8; 2 4 6 8; 2 4 6 8]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
