Professional Documents
Culture Documents
Syntax:disttool
Description:
disttool is a graphical interface for exploring the effects of changing parameters on the plot of a
cdf or pdf.
clc;
clearall;
n=10;
p=0.5;
for x=1:5
a=factorial(n)/(factorial(x)*factorial(n-x));
f(x)= a*(p^x)*(1-p)^(n-x);
end
plot(f)
Using disttool:
(2) Normal distribution function:
clc;
m=4;
sigma=1;
for x=1:15
a= 1/sqrt(2*3.14*sigma^2);
f(x)=a*exp(-((x-m)^2/(2*sigma^2)));
end
plot(f)
Using disttool:
(3) Poisson distribution function:
clc;
clearall;
l=5;
for x=1:20
a=l^x;
f(x)=(a/factorial(x))*exp(-l);
end
plot(f)
Using disttool:
(4) Rayleigh distribution function:
clc;
clearall;
b=2;
for x=1:16
a=x/b^2;
c=2*b^2;
f(x)=a*exp(-x^2/c);
end
plot(f)
Using disttool:
(5) Uniform distribution function:
clc;
clearall;
a=0;
b=1;
for x=1:3
f(x)=(x-a)/(b-a);
end
plot(f)
Using disttool:
Conclusion:
Using disttool, we are able to get idea about different pdf and cdf curves of different
distribution.Also we are able to observe how the distribution works for changes in value of their
distribution.