Table Of Contents

covarmx

Version:
    Last Modified: March 15, 2017

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

    Syntax

    c = covarmx(x)
    c = covarmx(x, option)
    c = covarmx(x, y)
    c = covarmx(x, y, option)
    Legacy name: cov

    Inputs

    x

    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, MathScript returns a zero matrix. If x is a vector, MathScript returns the first element in the result of using covarmx(x, x).

    y

    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.

    Name Description
    0 (default)

    Normalizes x by n-1.

    1

    Normalizes x by n.

    Outputs

    c

    Covariance matrix. If you specify c = covarmx(x, y) or c = covarmx(x, y, 1), c returns a 2-by-2 matrix.

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

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics