FUNCTION REFERENCE

quantile

Quantiles of data.

Quantiles of data.

Syntax

Q = quantile(X, p)

Syntax

Q = quantile(X, p, dim)

Syntax

Q = quantile(X, N)

p holds cumulative probabilities from 0 to 1, computed with the same midpoint rule as prctile: the k-th of n sorted values is the (k-0.5)/n quantile, with linear interpolation between and the extreme values outside. An integer N greater than 1 asks for the N quantiles at the probabilities (1:N)/(N+1). NaN values are ignored. Shapes follow prctile; so does the class rule (single in, single out; integers rejected).

Example

quantile([1 2 3 4], [0.25 0.5 0.75])   % [1.5 2.5 3.5]

Example

quantile(1:10, 3)   % [3 5.5 8]

Differences from MATLAB: Only the midpoint method; no 'Method' option, 'all' or vector dimensions. Real 2-D data only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.