Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

prob.UniformDistribution class

Package: prob
Superclasses: prob.ParametricTruncatableDistribution

Uniform probability distribution object

Description

prob.UniformDistribution is an object consisting of parameters and a model description for a uniform probability distribution. Create a probability distribution object with specified parameters using makedist.

Construction

pd = makedist('Uniform') creates a uniform probability distribution object using the default parameter values.

pd = makedist('Uniform','Lower',lower,'Upper',upper) creates a uniform distribution object using the specified parameter values.

Input Arguments

expand all

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

Data Types: single | double

Upper parameter for the uniform distribution, specified as a scalar value greater than lower.

Data Types: single | double

Properties

expand all

Lower parameter for the uniform distribution, stored as a scalar value.

Data Types: single | double

Upper parameter for the uniform distribution, stored as a scalar value greater than lower.

Data Types: single | double

Probability distribution name, stored as a character vector. This property is read-only.

Data Types: char

Logical flag for truncated distribution, stored as a logical value. If IsTruncated equals 0, the distribution is not truncated. If IsTruncated equals 1, the distribution is truncated. This property is read-only.

Data Types: logical

Number of parameters for the probability distribution, stored as a positive integer value. This property is read-only.

Data Types: single | double

Distribution parameter descriptions, stored as a cell array of character vectors. Each cell contains a short description of one distribution parameter. This property is read-only.

Data Types: char

Distribution parameter names, stored as a cell array of character vectors. This property is read-only.

Data Types: char

Distribution parameter values, stored as a vector. This property is read-only.

Data Types: single | double

Truncation interval for the probability distribution, stored as a vector containing the lower and upper truncation boundaries. This property is read-only.

Data Types: single | double

Methods

Inherited Methods

cdf Cumulative distribution function of probability distribution object
icdfInverse cumulative distribution function of probability distribution object
iqrInterquartile range of probability distribution object
median Median of probability distribution object
pdfProbability density function of probability distribution object
randomGenerate random numbers from probability distribution object
truncateTruncate probability distribution object
meanMean of probability distribution object
std Standard deviation of probability distribution object
varVariance of probability distribution object

Examples

expand 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

Definitions

expand all

Was this topic helpful?