User`s guide
Variance
5-508
element y
ij
containing the variance of element u
ij
over all inputs since the last
reset. For frame-based inputs, the output is a frame-based M-by-N matrix with
each element y
ij
containing the variance of the jth column over all inputs since
the last reset, up to and including element u
ij
of the current input.
If the
Reset port parameter is set to Non-zero sample, the optional Rst port
is enabled and the block resets the running variance when the scalar input at
the
Rst port is nonzero. (The Rst port can be disabled by setting the Reset port
parameter to
None.)
As in basic operation, length-M 1-D vector inputs and sample-based length-M
row vector inputs are both treated as M-by-1 column vectors.
Example The Variance block in the model below calculates the running variance of a
frame-based 3-by-2 (two-channel) matrix input,
u. The running variance is
reset at t=2 by an impulse to the block’s
Rst port.
The Variance block has the following settings:
•
Running variance =
•
Reset port = Non-zero sample
The Signal From Workspace block has the following settings:
•
Signal = u
•Sample time = 1/3
•Samples per frame = 3
where
u = [6 1 3 -7 2 5 8 0 -1 -3 2 1;1 3 9 2 4 1 6 2 5 0 4 17]'
The Discrete Impulse block has the following settings:
•
Delay (samples) = 2