Just want Matlab code please Thank you For the random variab
Just want Matlab code please. Thank you.
For the random variables below, create 1000 samples: uniform distribution between 10 to 20 exponential distribution with lambda equals to 0.5 Gaussian distribution with mean 10 and standard deviation 2 Plot the histogram for all three distributions. Find the PDFs using the histograms.Solution
udv = 10 + 10*rand(1000, 1);
edv = exprnd(0.5, 1000, 1);
gdv = normrnd(10, 2, 1000, 1);
figure
udvhist = histogram(udv);
histfit(udv, 50, \'kernel\');
figure
edvhist = histogram(edv);
histfit(edv, 50, \'kernel\');
figure
gdvhist = histogram(gdv);
histfit(gdv, 50, \'kernel\');
