Question: Write a user-defined function that sorts the elements of a matrix. For the function name and arguments, use B = matrixsort(A), where A is any
Write a user-defined function that sorts the elements of a matrix. For the function name and arguments, use B = matrixsort(A), where A is any size (mn) matrix and B is a matrix of the same size with the elements of A rearranged in descending order column after column with the (1,1) element the largest and the (m,n) element the smallest. Test your function on a 47 matrix with elements (integers) randomly distributed between 30 and 30. Use MATLABs randi function to generate the initial matrix.
(please write the explaination for each step)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
