Categories &

Functions List

Function Reference: unifcdf

statistics: p = unifcdf (x, a, b)
statistics: p = unifcdf (x, a, b, 'upper')

Continuous uniform cumulative distribution function (CDF).

For each element of x, compute the cumulative distribution function (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 p is the common size of x, a, and b. A scalar input functions as a constant matrix of the same size as the other inputs.

[…] = unifcdf (x, a, b, "upper") computes the upper tail probability of the continuous uniform distribution with parameters a, and b, at the values in x.

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.

MATLAB also accepts integer input here, returning the result in the integer class of the input; Octave rejects it, as it does for every other continuous distribution.

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

Source Code: unifcdf

Plot various CDFs from the continuous uniform distribution

 x = 0:0.1:10;
 p1 = unifcdf (x, 2, 5);
 p2 = unifcdf (x, 3, 9);
 plot (x, p1, '-b', x, p2, '-g')
 grid on
 xlim ([0, 10])
 ylim ([0, 1])
 legend ({'a = 2, b = 5', 'a = 3, b = 9'}, 'location', 'southeast')
 title ('Continuous uniform CDF')
 xlabel ('values in x')
 ylabel ('probability')
plotted figure