triangrnd
TRIANGRND creates random arrays from the triangular distribution.
R = TRIANGRND(A,M,B) returns an array of random numbers chosen from a triangular distribution with lower bound A, upper bound B, and mode M. The size of R is the common size of A, M, and B if all are arrays. If any parameters are scalars, the size of R is the size of the other parameter(s).
R = TRIANGRND(A,M,B,MM,NN,...) or R = TRIANGRND(A,M,B,[MM,NN,...]) returns an MM-by-NN-by-... array.
TRIANGRND uses Kotz & van Dorp's method [1].
The author can be contacted at galexander (at) Mines (dot) edu.
References:
[1] S. Kotz and J. R. Van Dorp. Beyond Beta: Other Continuous Families of Distributions with Bounded Support and Applications. Hackensack, New Jersey: World Scientific, 2004.
Cite As
Gauen Rhys Alexander (2024). triangrnd (https://www.mathworks.com/matlabcentral/fileexchange/86153-triangrnd), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.