<< distfun_histopdf Histogram distfun_histostat >>

distfun >> distfun > Histogram > distfun_histornd

distfun_histornd

Histogram random numbers

Calling Sequence

x=distfun_histornd(h)
x=distfun_histornd(h,[m,n])
x=distfun_histornd(h,m,n)

Parameters

h :

an histogram object

m :

a 1-by-1 matrix of floating point integers, the number of rows of x

n :

a 1-by-1 matrix of floating point integers, the number of columns of x

x:

a matrix of doubles, the random numbers.

Description

Generates random variables from the Histogram distribution function.

The h object must be created with distfun_histocreate.

Examples

m=1000;
data=distfun_normrnd(0,1,m,1);
h=distfun_histocreate("data",data);
x=distfun_histornd(h,1000,1);
scf();
histplot(10,x)
x = linspace(-4,4);
y=distfun_histopdf(x,h);
plot(x,y,"b-")
legend(["Histogram","Exact"]);
xtitle("Histogram")
xlabel("x")
ylabel("Density")

Authors


Report an issue
<< distfun_histopdf Histogram distfun_histostat >>