Question: Write a matlab code using 'for' loop that does the following five time : a) Create an empty vector W. b)Generate a random integer between

Write a matlab code using 'for' loop that does the following five time: a) Create an empty vector W. b)Generate a random integer between -50 and 50 (inclusive). c) If the number is 40 or less then put the number at the end of v (the length of v will increase by 1), generate another random number, and repeat this analysis. d) If the number is more than 40 then put the number at the end of v (the length of v will increase by 1) and stop generating numbers. Each time you finish creating a vector of random numbers, plot it as a data series using a solid line with open circles. All five vectors should be plotted on the same plot. Label your axes clearly, add a legend.

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!