Statistics Toolbox    
unidcdf

Discrete uniform cumulative distribution (cdf) function

Syntax

Description

P = unidcdf(X,N) computes the discrete uniform cdf 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 maximum observable values in N must be positive integers.

The discrete uniform cdf is

The result, p, is the probability that a single observation from the discrete uniform distribution with maximum N will be a positive integer less than or equal to x. The values x do not need to be integers.

Examples

What is the probability of drawing a number 20 or less from a hat with the numbers from 1 to 50 inside?

See Also

cdf, unidinv, unidpdf, unidrnd, unidstat


  ttest2 unidinv