28. Write a user-defined function that sorts the elements of a matrix. For the function name and...

Question:

28. 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 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. If available, use the userdefined function downsort from the previous problem as a subfunction within matrixsort.
Test your function on a matrix with elements (integers) randomly distributed between –30 and 30. Use MATLAB’s randi function to generate the initial matrix.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: