Hypergeometric random numbers
R = hygernd(M,K,N)
R = hygernd(M,K,N,m,n,...)
R = hygernd(M,K,N,[m,n,...])
R = hygernd(M,K,N) generates
random numbers from the hypergeometric distribution with corresponding
size of the population,
M, number of items with
the desired characteristic in the population,
and number of samples drawn,
N can be vectors, matrices, or multidimensional
arrays that all have the same size, which is also the size of
A scalar input for
expanded to a constant array with the same dimensions as the other
R = hygernd(M,K,N,m,n,...) or
= hygernd(M,K,N,[m,n,...]) generates an
can each be scalars or arrays of the same size as
numbers = hygernd(1000,40,50) numbers = 1
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
The generated code can return a different sequence of numbers than MATLAB® if either of the following is true:
The output is nonscalar.
An input parameter is invalid for the distribution.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Introduced before R2006a