The Gaussian distribution also known as the Normal distribution, is given by the following
equation:
π¦(π₯) = ππ₯π β(π₯βπ)^2/2π^2
where parameter π is the mean and π the standard deviation.
(i) Write a MATLAB code to create a 1000 point Gaussian distribution of random numbers
having π = 0 and π = 1. (20)
(ii) Plot this distribution. (10)
i: >>x=normrnd(0,1,1000);
ii:
>> y=@(x)exp(-x.^2/2);
>> x=-5:0.01:5;
>> plot(x,y(x))
Comments
Leave a comment