Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

cov (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the spectral analysis and the statistics classes.

Syntax

c = cov(x)

c = cov(x, option)

c = cov(x, y)

c = cov(x, y, option)

Description

Computes the covariance matrix of the input elements. c = cov(x, y) and c = cov(x, y, 1) are equivalent to cov([x(:), y(:)]).

Examples

Inputs

Name Description
x Specifies a real or complex matrix. Each column of x represents one vector of observed samples from one variable. Each row of x represents an observation from each variable. If x has only one row, LabVIEW returns a zero matrix.
y Specifies a real or complex matrix of the same size as x.
option Specifies whether to normalize x by n or n-1, where n is the length of x when x is a vector or the number of the rows in x when x is a matrix. option is an integer that accepts the following values.

0 (default) Normalizes x by n-1.
1 Normalizes x by n.

Outputs

Name Description
c Returns the covariance matrix. If you specify c = cov(x, y) or c = cov(x, y, 1), c returns a 2-by-2 matrix.

Examples

C = cov(rand(5, 6), 1)

C = cov(rand(5, 1), rand(5, 1), 1)

Related Topics

corrcoef
std
xcov


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit