Categories &

Functions List

Function Reference: unifinv

statistics: x = unifinv (p, a, b)

Inverse of the continuous uniform cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the continuous uniform distribution with parameters a and b, which define the lower and upper bounds of the interval [a, b]. The size of x is the common size of p, a, and b. A scalar input functions as a constant matrix of the same size as the other inputs.

Further information about the continuous uniform distribution can be found at https://en.wikipedia.org/wiki/Continuous_uniform_distribution

Input arguments must be double or single; integer, logical, and character arrays are rejected. MATLAB accepts a character array and evaluates it at the character codes, which Octave deliberately does not, since a character array is an integer type and integers are refused too.

See also: unifcdf, unifpdf, unifrnd, unifit, unifstat

Source Code: unifinv

Plot various iCDFs from the continuous uniform distribution

 p = 0.001:0.001:0.999;
 x1 = unifinv (p, 2, 5);
 x2 = unifinv (p, 3, 9);
 plot (p, x1, '-b', p, x2, '-g')
 grid on
 xlim ([0, 1])
 ylim ([0, 10])
 legend ({'a = 2, b = 5', 'a = 3, b = 9'}, 'location', 'northwest')
 title ('Continuous uniform iCDF')
 xlabel ('probability')
 ylabel ('values in x')
plotted figure