Aim: To Study RANDTOOL and Plot Exponential and Normal Random Variable Function
Aim: To Study RANDTOOL and Plot Exponential and Normal Random Variable Function
variable function.
RANDTOOL:
Syntax:
Randtool
Description:
randtool opens the Random Number Generation Tool.
The Random Number Generation Tool is a graphical user interface that generates random
samples from specified probability distributions and displays the samples as histograms. Use
the tool to explore the effects of changing parameters and sample size on the distributions.
[1] Exponential Function:
(1.1) For 100 samples:
clc;
m=1;
a= 1/m;
f=a.*exp(-x./m);
clc;
clearall;
m=0;
sig=1;
a= 1/sqrt(2*pi*sig^2);
f=a.*exp(-((x-m).^2./(2*sig.^2)));
x=0:0.7:8;
subplot(1,3,1);hist(normrv,x)
title('100 samples');
x=0:0.5:8;
subplot(1,3,2);hist(normrv1,x)
title('500 samples');
x=0:0.3:8;
subplot(1,3,3);hist(normrv2,x)
title('10000 samples');
x=0:0.5:8;
subplot(1,3,2);hist(exprv1,x)
title('1000 samples');
x=0:0.3:8;
subplot(1,3,3);hist(exprv2,x)
title('10000 samples');
Conclusion:
The random samples that are generated through randtool are more meaningful for a given
distribution then the samples that are taken randomly through rand command.Also as the
number of samples increases, it tends to give us a bettter idea about a given distribution.