random number generator for linear distribution

Random number generator for linear distribution.

Vous suivez désormais cette soumission

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

Citation pour cette source

Samuel Cheng (2026). random number generator for linear distribution (https://fr.mathworks.com/matlabcentral/fileexchange/7395-random-number-generator-for-linear-distribution), MATLAB Central File Exchange. Extrait(e) le .

Catégories

En savoir plus sur Random Number Generation dans Help Center et MATLAB Answers

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.0.0.0