Version:

Computes the variance of the input elements.

Syntax

y = var(x)
y = var(x, w)
y = var(x, w, d)

x

Scalar or array of any dimension.

w

Weight. w is a scalar or a vector. If w is a scalar, w is an indicator, which can only be 0 or 1. If w is a vector, w is the weight.

d

Specifies the dimension of x across which to compute the variance. d can be in a range of 1 to the maximum supported array dimension (32). If you do not specify d, the function works with the first dimension whose size is not equal to 1.

y

Variance of x. y is a scalar or an array.