Question: can anyone help me write a script for this. If you use the MATLAB function rand(1), it generates a random number between 0 and 1.

 can anyone help me write a script for this. If you

can anyone help me write a script for this.

If you use the MATLAB function rand(1), it generates a random number between 0 and 1. That is, if yop use the command xerand(1) then x is a random number between 0 and 1, and every time it is called, x would be a different random number. (a) Use a "for loop" and the function rand(1) to create a vector x(n) with 500 elements. Then compute the average value of the elements in x. (b) Use another "for loop" and rand(1) to create a vector y(n) of 500 random numbers between the numbers -2 and +2

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!