# UniformDistribution

Uniform probability distribution object

## Description

A UniformDistribution object consists of parameters and a model description for a uniform probability distribution.

The uniform distribution has a constant probability density function between its two parameters, Lower (the minimum) and Upper (the maximum).

The uniform distribution uses the following parameters.

ParameterDescriptionSupport
LowerLower limit$-\infty <\text{Lower}<\text{Upper}$
UpperUpper limit$\text{Lower}<\text{Upper}<\infty$

## Creation

Create a UniformDistribution probability distribution with specified parameter values object using makedist.

## Properties

expand all

### Distribution Parameters

Lower limit for the uniform distribution, specified as a scalar value.

Data Types: single | double

Upper limit for the uniform distribution, specified as a scalar value greater than Lower.

Data Types: single | double

### Distribution Characteristics

Logical flag for truncated distribution, specified as a logical value. If IsTruncated equals 0, the distribution is not truncated. If IsTruncated equals 1, the distribution is truncated.

Data Types: logical

Number of parameters for the probability distribution, specified as a positive integer value.

Data Types: double

Distribution parameter values, specified as a vector of scalar values.

Data Types: single | double

Truncation interval for the probability distribution, specified as a vector of scalar values containing the lower and upper truncation boundaries.

Data Types: single | double

### Other Object Properties

Probability distribution name, specified as a character vector.

Data Types: char

Distribution parameter descriptions, specified as a cell array of character vectors. Each cell contains a short description of one distribution parameter.

Data Types: char

Distribution parameter names, specified as a cell array of character vectors.

Data Types: char

## Object Functions

 cdf Cumulative distribution function icdf Inverse cumulative distribution function iqr Interquartile range of probability distribution mean Mean of probability distribution median Median of probability distribution pdf Probability density function plot Plot probability distribution object random Random numbers std Standard deviation of probability distribution truncate Truncate probability distribution object var Variance of probability distribution

## Examples

collapse all

Create a uniform distribution object using the default parameter values.

pd = makedist('Uniform')
pd =
UniformDistribution

Uniform distribution
Lower = 0
Upper = 1

Create a uniform distribution object by specifying parameter values.

pd = makedist('Uniform','Lower',-4,'Upper',2)
pd =
UniformDistribution

Uniform distribution
Lower = -4
Upper =  2

Compute the interquartile range of the distribution

r = iqr(pd)
r = 3

## Version History

Introduced in R2013a