Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(Using Matlab please)Given the vector x = [17 ? 3 ? 47 5 29 ? 37 51 ? 7 19], create a script that will
(Using Matlab please)Given the vector x = [17 ? 3 ? 47 5 29 ? 37 51 ? 7 19], create a script that will rearrange this in descending order of the numbers in the vector, with all the negative numbers first. That is, the output should be y = [?3 ? 7 ? 37 ? 47 51 29 19 17 5]. The script should be written to work with a vector of any length. If the value 0 exists in the original vector, then it should be placed along with the negative quantities (it will be first element of the resulting vector). Save this script in a file called rearrange.m.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started