triangrnd

Random arrays from the triangular distribution.
10 Downloads
Updated 24 Feb 2021

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.

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 (2026). triangrnd (https://www.mathworks.com/matlabcentral/fileexchange/86153-triangrnd), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.2.0

Fixed bug where triangrnd was not accepting varargin as a vector.

1.1.0

Fixed a bug where && was used to compare non-scalar logical variables.

1.0.0