| Statistics Toolbox | Search  Help Desk |
| unidpdf | Examples |
Discrete uniform probability density function (pdf).
Syntax
Y = unidpdf(X,N)
Description
unidpdf(X,N) computes the discrete uniform pdf with parameter settings, N, at the values in X. The arguments X and N must be the same size except that a scalar argument functions as a constant matrix of the same size of the other argument. The parameter N must be a positive integer. The discrete uniform pdf is:
Examples
For fixed n, the uniform discrete pdf is a constant.y = unidpdf(1:6,10)
y =
0.1000 0.1000 0.1000 0.1000 0.1000 0.1000
Now fix x , and vary n.
likelihood = unidpdf(5,4:9)
likelihood =
0 0.2000 0.1667 0.1429 0.1250 0.1111