FUNCTION REFERENCE

skewness

Sample skewness.

Sample skewness.

Syntax

y = skewness(X)

Syntax

y = skewness(X, flag)

Syntax

y = skewness(X, flag, dim)

The third central moment divided by the second central moment to the power 1.5, both with divisor n. flag 1 or [] (default) gives this biased value; flag 0 multiplies it by sqrt(n*(n-1))/(n-2), which needs at least 3 values (NaN otherwise). NaN values are ignored. Constant data gives NaN (0/0). skewness([]) is NaN. X is double, single or logical: single input gives single results (computed in double, then rounded), and integer input is an error, as the published page lists single and double only.

Example

skewness([1 2 3 10])   % 1.0182

Example

skewness([1 2 3 10], 0)   % 1.7636

Differences from MATLAB: No '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.