unidpdf
Discrete uniform probability density function
Syntax
Y = unidpdf(X,N)
Description
Y = unidpdf(X,N)
computes the discrete uniform pdf at each of the values inX
using the corresponding maximum observable value inN
.X
andN
can be vectors, matrices, or multidimensional arrays that have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters inN
must be positive integers.
The discrete uniform pdf is
You can think ofyas the probability of observing any one number between 1 andn.
Examples
For fixedn
, the uniform discrete pdf is a constant.
y = unidpdf(1:6,10) y = 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000
Now fixx
, and varyn
.
可能性可能性= unidpdf (9) 0.2000 = 00.1667 0.1429 0.1250 0.1111