Random Numbers, Mean and Standard Deviation in MATLAB:
In probability theory, the normal distribution is a very commonly occurring probability distribution — a function that tells the probability that any real observation will fall between any two real limits or real numbers, as the curve approaches zero on either side. Normal distributions are extremely important in statistics and are often used in the natural and social sciences for real-valued random variables whose distributions are not known.
Matlab can construct an array of uniformly distributed random numbers with the rand command. The command randn constructs an array with normally distributed random numbers.
Use X = randn(1,n) and Y = rand(1,n) to generate a one-dimensional array of random numbers.
a) Construct an array with 1000 elements using randn() and rand().
b) Compute the mean and standard deviation for both arrays.
c) Use histogram function to show the distribution of both arrays.