Just Want Matlab Code For the random variables below create

Just Want Matlab Code.

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

C:

WRITING GAUSSIAN FUNCTION in matlab

function f = gauss_distribution(x, mu, s)
p1 = -.5 * ((x - mu)/s) .^ 2;
p2 = (s * sqrt(2*pi));
f = exp(p1) ./ p2;

then assign values , here standard deviation(s)=2

mean=10

f = gauss_distribution(x, m, s);
plot(x,f,\'.\')
grid on
title(\'Bell Curve\')
xlabel(\'Randomly produced numbers\')
ylabel(\'Gauss Distribution\')

A))UNIFORM DISTRIBUTION OF RANDOM VARIABLES:

here N represents number of samples. in above question N=1000

histogarm of uniform distribution

Just Want Matlab Code. For the random variables below, create 1000 samples: uniform distribution between 10 to 20 exponential distribution with lambda equals to

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site