Documentation

unifcdf

Continuous uniform cumulative distribution function

Syntax

p = unifcdf(x,a,b)
p = unifcdf(x,a,b,'upper')

Description

p = unifcdf(x,a,b)returns the uniform cdf at each value inxusing the corresponding lower endpoint (minimum),aand upper endpoint (maximum),b.x,a, andbcan be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant matrix with the same dimensions as the other inputs.

p = unifcdf(x,a,b,'upper')returns the complement of the uniform cdf at each value inx, using an algorithm that more accurately computes the extreme upper tail probabilities.

The uniform cdf is

p = F ( x | a , b ) = x a b a I [ a , b ] ( x )

The standard uniform distribution has a =0and b =1.

Examples

collapse all

What is the probability that an observation from a standard uniform distribution will be less than 0.75?

probability = unifcdf(0.75)
probability = 0.7500

What is the probability that an observation from a uniform distribution witha=-1andb=1will be less than 0.75?

probability = unifcdf(0.75,-1,1)
probability = 0.8750

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?