File Exchange

image thumbnail


version 1.2.0 (3.29 KB) by Gauen Rhys Alexander
Random arrays from the triangular distribution.


Updated 24 Feb 2021

View Version History

View License

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.

[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 (2021). triangrnd (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2020b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!