Question: please solve all parts using Matlab 1) 2) 3) 4) 5) Write a function my trace to compute the trace of a matrix Write a
please solve all parts using Matlab
1) 2) 3) 4) 5) Write a function my trace to compute the trace of a matrix Write a function my sum to sum all the elements of a matrix Write a function sum rows to sum all the rows of a matrix, note this should return back a row vector Write a function to sum cols sum the columns ofa matrix, note this should return back a column vector Combine the functions in 3 and 4 into 1 function sum row or cols which takes an additional parameter that let's you choose to sum either columns or rows. 1 should sum over columns, 2 should sum over rows. i.e. you should call sum row or cols (A, 1) or sum row or _ cols (A, 2)
Step by Step Solution
3.50 Rating (147 Votes )
There are 3 Steps involved in it
To solve each part of the problem using MATLAB here are the corresponding functions 1 Compute the Tr... View full answer
Get step-by-step solutions from verified subject matter experts
