Question: MATlAB Task Write a function that takes one input an MxNxK matrix and returns one output - A row vector having sum of elements along
MATlAB

Task Write a function that takes one input an MxNxK matrix and returns one output - A row vector having sum of elements along the principal diagonal of the matrix for each page. If the matrix is not a square matrix(ie. M '=N) display error message asking the matrix to be square Function Details Name the function practicum112 Name the input matrix A Name the output principal diagonal_sum Print appropriate error message Note You are NOT allowed to use any buil in function EXCEPT for the size ()and zeros () function You must use for loops to solve this problem. Example Let A(:,:,3) [13 14 16 17] = ; Then principal_diagonal_sum will be equal to [6 18 30]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
