Statistics: triinv

### Function Reference: `triinv`

statistics: x = triinv (p, a, b, c)

Inverse of the triangular cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the triangular distribution with parameters a, b, and c on the interval `[a, b]`. The size of x is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs.

Further information about the triangular distribution can be found at https://en.wikipedia.org/wiki/Triangular_distribution

See also: tricdf, tripdf, trirnd

Source Code: triinv

### Example: 1

     ## Plot various iCDFs from the triangular distribution
     p = 0.001:0.001:0.999;
     x1 = triinv (p, 3, 6, 4);
     x2 = triinv (p, 1, 5, 2);
     x3 = triinv (p, 2, 9, 3);
     x4 = triinv (p, 2, 9, 5);
     plot (p, x1, "-b", p, x2, "-g", p, x3, "-r", p, x4, "-c")
     grid on
     ylim ([0, 10])
     legend ({"a = 3, b = 6, c = 4", "a = 1, b = 5, c = 2", ...
              "a = 2, b = 9, c = 3", "a = 2, b = 9, c = 5"}, ...
             "location", "northwest")
     title ("Triangular CDF")
     xlabel ("probability")
     ylabel ("values in x")