In: Computer Science
Make a histogram of each random variable using the Matlab “hist” function. Normalize the histogram before plotting to yield a pdf (probability density function). On top of the histogram superimpose the theoretical pdf of the appropriate distribution
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
S=2*randn(1,100000)+1;
histogram(S,'Normalization','probability');
hold on;
x=-10:0.01:10;
y=1/(2*sqrt(2*pi))*exp(-(x-1).^2/8);
plot(x,y);
Kindly revert for any queries
Thanks.