Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

unifpdf - Continuous uniform probability density function

Syntax

Y = unifpdf(X,A,B)

Description

Y = unifpdf(X,A,B) computes the continuous uniform pdf at each of the values 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 array with the same dimensions as the other inputs. The parameters in B must be greater than those in A.

The continuous uniform distribution pdf is

The standard uniform distribution has A = 0 and B = 1.

Examples

For fixed a and b, the uniform pdf is constant.

x = 0.1:0.1:0.6;
y = unifpdf(x)
y =
   1   1   1   1   1   1

What if x is not between a and b?

y = unifpdf(-1,0,1)
y =
   0

See Also

pdf, unifcdf, unifinv, unifstat, unifit, unifrnd

Uniform Distribution (Continuous)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS