Generate random integers given probability distribution

The code generates the random integers for the probability distribution (probability mass function (PMF)) defined by the vector.

You are now following this Submission

pmfRND Ouputs random integers for given PMF

x = pmfRND(f,X) returns mxn matrix whose values are Zipf distributed,
where f > 0 is the PMF (discrete PDF) such that sum(f) = 1;
X = [m,n] is the size of desired ouput random matrix.

Cite As

NAVNEET GARG (2026). Generate random integers given probability distribution (https://in.mathworks.com/matlabcentral/fileexchange/72186-generate-random-integers-given-probability-distribution), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Random Number Generation in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0