(To be removed) Variance of input or sequence of inputs
The Variance
object computes variance for an input or
sequence of inputs.
The dsp.Variance
System
object™ will be removed in a future release. To compute the variance, use the
var
function. To compute the running
variance, use the dsp.MovingVariance
object. For more information,
see Compatibility Considerations.
To compute the variance of an input or sequence of inputs:
Create the dsp.Variance
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
returns a variance
System
object, var
= dsp.Variancevar
, that computes the variance of an input or a
sequence of inputs over the specified Dimension
.
returns a variance System
object, var
= dsp.Variance(Name,Value
)var
, with each specified property set to the specified
value.
To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named obj
, use
this syntax:
release(obj)
Note: If you are using R2016a or an
earlier release, replace each call to the object with the equivalent step
syntax. For example, obj(x)
becomes
step(obj,x)
.
Compute the running variance of the signal. That is, compute the variance of each sample in the input signal with respect to all the previous samples.
var = dsp.Variance; var.RunningVariance = true; input = randn(100,1); variance = var(input);
This object implements the algorithm, inputs, and outputs described on the Variance block reference page. The object properties correspond to the block parameters, except:
Reset port block parameter corresponds to both the ResetCondition
and the ResetInputPort
object properties.