Question: A vector is given by x = [8 25 60 46 6 18 13 20 72 27 10 59 33). Using conditional statements and loop(s),

 A vector is given by x = [8 25 60 46

A vector is given by x = [8 25 60 46 6 18 13 20 72 27 10 59 33). Using conditional statements and loop(s), write the code for a program that: a) counts the number of elements in vector x that have values between 14 and 42 and creates a new vector "y" that contains only the elements of x in that specified range. b) sums the values of those elements of x that are lower than 26. c) creates a vector of 7 ranges between 5 and 75, counts the number of elements in vector x that fall in each range, and assigns each count obtained above to each element of a new vector z" made also of 7 elements. Use nested loops here. Do not use the Matlab functions find" or "sum. The program should work for any vector and vector size in case vector "x" is changed

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!