| Statistics Toolbox | Search  Help Desk |
| unifpdf | Examples |
Continuous uniform probability density function (pdf).
Syntax
Y = unifpdf(X,A,B)
Description
unifpdf(X,A,B) computes the continuous uniform pdf with parameters A and B at the values in X. The arguments X, A, and B must all be the same size except that scalar arguments function as constant matrices of the common size of the other arguments. The parameter B must be greater than A. The continuous uniform distribution pdf is:
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