varVariance
For a given vector
If NaN, the variance NaN.
v = var(A)A is empty, v is an empty array.A is a scalar, v is equal to 0.A is a vector, v is the variance of elements along the longer dimension of A.A is a matrix or multi-dimensional array, elements of v are variances of vectors of A along the first non-singleton dimension.s = var(A, w)s = var(A) above, with the input w that determines which of the above formulas will be used.w == 0, it uses Equation (1). When w == 1, it uses Equation (2).s = var(A, w, k)s = var(A, w) above, except that elements of s correspond to vectors of A along its k-th dimension.k should be a real positive integer scalar.k refers to a singleton dimension, v will be an array of zeros.