From 9:00 AM - 12:00 PM CDT on Saturday, June 6th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# crosscovar (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: spectral analysis

Requires: MathScript RT Module

## Syntax

c = crosscovar(a)

c = crosscovar(a, l)

c = crosscovar(a, option)

c = crosscovar(a, l, option)

c = crosscovar(a, b)

c = crosscovar(a, b, l)

c = crosscovar(a, b, option)

c = crosscovar(a, b, l, option)

[c, d] = crosscovar(a)

[c, d] = crosscovar(a, l)

[c, d] = crosscovar(a, option)

[c, d] = crosscovar(a, l, option)

[c, d] = crosscovar(a, b)

[c, d] = crosscovar(a, b, l)

[c, d] = crosscovar(a, b, option)

[c, d] = crosscovar(a, b, l, option)

Legacy Name: `xcov`

## Description

Computes the cross-covariance of the inputs.

Examples

## Inputs

Name Description
a Specifies a vector or matrix.
b Specifies a vector.
l Controls the length of the cross-covariance. If a is a vector of length n, c = crosscovar(a, l) returns a vector of length 2*l+1. LabVIEW pads l with zeros when l is greater than or equal to n.
option Specifies the normalization method to use to compute the cross-covariance between a and b. option is a string that accepts the following values.

 'biased' Applies biased normalization. 'coeff' Applies normalization such that the covariance at zero lag is 1. 'none' (default) Does not apply normalization. 'unbiased' Applies unbiased normalization.

## Outputs

Name Description
c Returns the cross-covariance between a and b. If a is a matrix, c = crosscovar(a) returns the cross-covariance of all combinations of the columns of a. c is vector or matrix.
d Returns the indexes of the cross-covariance. If you specify l, d is [-l, -l+1, ..., 0, ..., l-1, l]. d is a vector.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

A = [0.1, 0.2, 0.3, 0.4]
C = crosscovar(A)