Categories &

Functions List

Function Reference: cdfplot

statistics: hCDF = cdfplot (x)
statistics: [hCDF, stats] = cdfplot (x)

Display an empirical cumulative distribution function.

hCDF = cdfplot (x) plots an empirical cumulative distribution function (CDF) of the observations in the data sample vector x. x may be a row or column vector, and represents a random sample of observations from some underlying distribution.

cdfplot plots F(x), the empirical (or sample) CDF versus the observations in x. The empirical CDF, F(x), is defined as follows:

F(x) = (Number of observations <= x) / (Total number of observations)

for all values in the sample vector x. NaNs are ignored. hCDF is the handle of the empirical CDF curve (a handle hraphics ’line’ object).

[hCDF, stats] = cdfplot (x) also returns a structure with the following fields as a statistical summary.

STATS.minminimum value of x
STATS.maxmaximum value of x
STATS.meansample mean of x
STATS.mediansample median (50th percentile) of x
STATS.stdsample standard deviation of x

See also: qqplot, cdfcalc

Source Code: cdfplot

Example: 1

 

 x = randn(100,1);
 cdfplot (x);

                    
plotted figure