| Statistics Toolbox | ![]() |
Discrete uniform probability density function (pdf).
Syntax
Y = unidpdf(X,N)
Description
unidpdf(X,N)
computes the discrete uniform pdf at each of the values in X using the corresponding parameters in N. Vector or matrix inputs for X and N must have the same size. A scalar input is expanded to a constant matrix with the same dimensions as the other inputs. The parameters in N must be positive integers.
You can think of y as the probability of observing any one number between 1 and n.
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
likelihood = unidpdf(5,4:9)
likelihood =
0 0.2000 0.1667 0.1429 0.1250 0.1111
See Also
pdf, unidcdf, unidinv, unidrnd, unidstat
| unidinv | unidrnd | ![]() |