Package: dsp
Variance of input or sequence of inputs
The Variance
object computes variance for an
input or sequence of inputs.
To compute the variance of an input or sequence of inputs:
Define and set up your variance System object™. See Construction.
Call step
to compute the variance according to
the properties of dsp.Variance
. The behavior of step
is
specific to each object in the toolbox.
H = dsp.Variance
returns
a variance System object, H
, that computes the
variance of an input or a sequence of inputs over the specified Dimension
.
H = dsp.Variance('
returns
a variance System object, PropertyName
',PropertyValue
,...)H
, with each specified
property set to the specified value.

Enable calculation over time Set this property to 

Enable reset input port Set this property to 

Reset condition for running variance mode Specify which event resets the running variance as one of  

Dimension to operate along Specify how the object performs the variance calculation over
the data as one of  

Numerical dimension to operate along Specify the input signal dimension (onebased value) the object
uses to compute variance. The cannot exceed the number of dimensions
in the input signal. This property applies when you set the 
clone  Create variance object with same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs of step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
reset  Reset variance to zero 
step  Variance of input 
Compute the running variance for a signal:
hvar = dsp.Variance; hvar.RunningVariance = true; x = randn(100,1); y = step(hvar, x); % y(i) is the running variance of all values in the vector x(1:i)
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.