zipf_rand(N, expn, M)

Generate random numbers based on Zipf distribution

You are now following this Submission

Generate random numbers based on Zipf distribution
Author: Tuyen Tran (tuyen.tran@rutgers.edu). Oct 2015
Reference: https://en.wikipedia.org/wiki/Zipf's_law

N Number of Elements
expn Exponent
M Number of sample to be generated (in range [1,N])

Example: zipf_rand(3,1,4)
ans = 3 2 1 1

Cite As

Tuyen Tran (2026). zipf_rand(N, expn, M) (https://www.mathworks.com/matlabcentral/fileexchange/53568-zipf_rand-n-expn-m), 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.0