random number generator for linear distribution

Random number generator for linear distribution.
1,3K Downloads
Aktualisiert 11. Apr 2005

Lizenz anzeigen

Return random variable(s) with linear distribution within [0,1] and 0 outside; m specifies the slope

In other word
P(x)= mx+b if 0<=x<=1
P(x)= 0 otherwise

where b=1-m/2 as int P(x) should be 1

Usage: ran=randl(m,SIZE)

E.g. X=randl(1,[20,20])
X is matrix with size [20,20] and with distribution
p(x)=x+0.5 if 0<=x<=1 and p(x)=0 otherwise

Zitieren als

Samuel Cheng (2024). random number generator for linear distribution (https://www.mathworks.com/matlabcentral/fileexchange/7395-random-number-generator-for-linear-distribution), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R12
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0