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:
Define and set up your System object™. See Construction.
step to compute the mean according to the
dsp.Mean. The behavior of
specific to each object in the toolbox.
Starting in R2016b, instead of using the
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
|reset||Reset internal states of mean-finding object|
|Common to All System Objects|
Create System object with same property values
Expected number of inputs to a System object
Expected number of outputs of a System object
Check locked states of a System object (logical)
Allow System object property value changes
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).