Question: A.23 Write a user-defined function that sorts the elements of a vector (of any length) from the largest to the smallest. For the function name

 A.23 Write a user-defined function that sorts the elements of a

A.23 Write a user-defined function that sorts the elements of a vector (of any length) from the largest to the smallest. For the function name and arguments use y -downsort (x). The input to the function is a vector x of any length, and the output y is a vector in which the elements of x are arranged in descending order. Do not use the MATLAB sort function. Test your function by using it in the Command Window to rearrange the elements of the following vector: [-2,8, 29,0, 3,-17,-1, 54, 15,-10, 32 , 0.8 m 14 m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!