Statistics Toolbox    
unidpdf

Discrete uniform probability density function (pdf)

Syntax

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.

The discrete uniform pdf is

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.

Now fix x, and vary n.

See Also

pdf, unidcdf, unidinv, unidrnd, unidstat


  unidinv unidrnd