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