trimmean
"all"
)Compute the trimmed mean.
The trimmed mean of x is defined as the mean of x excluding the
highest and lowest data values of x, calculated as
k = n * (p / 100) / 2)
, where n is the sample size.
m = trimmean (x, p)
returns the mean of x
after removing the outliers in x defined by p percent.
trimmean (x, p)
is the
mean of all the values of x, computed after removing the outliers.
trimmean (x, p)
is a
row vector of column means, computed after removing the outliers.
trimmean
operates
along the first nonsingleton dimension of x.
To specify the operating dimension(s) when x is a matrix or a multidimensional array, use the dim or vecdim input argument.
trimmean
treats NaN
values in x as missing values and
removes them.
m = trimmean (x, p, flag)
specifies how to
trim when , i.e. half the number of outliers, is not an integer.
flag can be specified as one of the following values:
Value | Description | |
---|---|---|
"round" | Round to the nearest integer. This is the default. | |
"floor" | Round down to the next smaller integer. | |
"weighted" | If , where is an integer and is a fraction, compute a weighted mean with weight for the -th and -th values, and full weight for the values between them. |
m = trimmean (…,
returns the trimmed mean
of all the values in x using any of the input argument combinations in
the previous syntaxes.
"all"
)
m = trimmean (…, dim)
returns the trimmed mean along
the operating dimension dim specified as a positive integer scalar. If
not specified, then the default value is the first nonsingleton dimension of
x, i.e. whose size does not equal 1. If dim is greater than
ndims (X)
or if size (x, dim)
is 1, then
trimmean
returns x.
m = trimmean (…, vecdim)
returns the trimmed mean
over the dimensions specified in the vector vecdim. For example, if
x is a 2-by-3-by-4 array, then mean (x, [1 2])
returns a
1-by-1-by-4 array. Each element of the output array is the mean of the
elements on the corresponding page of x. If vecdim indexes all
dimensions of x, then it is equivalent to mean (x, "all")
.
Any dimension in vecdim greater than ndims (x)
is ignored.
See also: mean
Source Code: trimmean