# 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 in `x` using the corresponding lower endpoint (minimum), `a` and upper endpoint (maximum), `b`. `x`, `a`, and `b` can 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 in `x`, using an algorithm that more accurately computes the extreme upper tail probabilities.

The uniform cdf is

`$p=F\left(x|a,b\right)=\frac{x-a}{b-a}{I}_{\left[a,b\right]}\left(x\right)$`

The standard uniform distribution has a = `0` and 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 with `a` = `-1` and `b` = `1` will be less than 0.75?

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

## Version History

Introduced before R2006a