harmmean
Compute the harmonic mean of x.
harmmean(x)
returns the
harmonic mean of the elements in x defined as
$$ {\rm harmmean}(x) = \frac{N}{\sum_{i=1}^N \frac{1}{x_i}} $$
where is the length of the x vector.
harmmean(x)
returns a row
vector with the harmonic mean of each columns in x.
harmmean(x)
operates along the first nonsingleton dimension of x.
harmmean(x, "all")
returns the harmonic mean of all the elements
in x. If x contains any 0, then the returned value is 0.
harmmean(x, dim)
returns the harmonic mean along the
operating dimension dim of x. Calculating the harmonic mean of
any subarray containing any 0 will return 0.
harmmean(x, vecdim)
returns the harmonic mean over the
dimensions specified in the vector vecdim. For example, if x is
a 2-by-3-by-4 array, then harmmean(x, [1 2])
returns a
1-by-1-by-4 array. Each element of the output array is the harmonic mean of
the elements on the corresponding page of x. If vecdim indexes
all dimensions of x, then it is equivalent to harmmean (x,
"all")
. Any dimension in vecdim greater than ndims (x)
is ignored.
harmmean(…, nanflag)
specifies whether to exclude NaN
values from the calculation, using any of the input argument combinations in
previous syntaxes. By default, harmmean includes NaN values in the
calculation (nanflag has the value "includenan"). To exclude NaN
values, set the value of nanflag to "omitnan".
Source Code: harmmean