Find mean value of input or sequence of inputs
dsp.Mean object finds the mean of an input
or sequence of inputs.
To compute the mean of an input or sequence of inputs:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
Running mode in the
be removed in a future release. To compute the running mean in MATLAB®,
mn = dsp.Mean returns
mn, that computes the mean of an input
or a sequence of inputs.
mn = dsp.Mean(' returns
a mean-finding object,
mn, with each specified
property set to the specified value.
Calculate over single input or multiple inputs
When you set this property to
Additional input to enable resetting of running mean
Set this property to
Condition that triggers resetting of running mean
Specify the event that resets the running maximum as one of |
Dimension to operate along
Specify how the mean calculation is performed over the data as one of |
Numerical dimension to calculate over
Specify the integer dimension, indexed from one, of the input signal over which the object
calculates the mean. The value cannot exceed the number of dimensions in the
input signal. This property only applies when you set the Dimension property to
|reset||Reset internal states of mean-finding object|
Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent
step syntax. For example, myObject(x) becomes step(myObject,x).
mean1 = dsp.Mean; x = randn(100,1); y = mean1(x);
mean2 = dsp.Mean; mean2.RunningMean = true; x = randn(100,1); yrmean = mean2(x);
This object implements the algorithm, inputs, and outputs described on the Mean block reference page. The object properties correspond to the block parameters.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).