Skip to content

var

statistics · scripts/statistics/var.m

V = var (A)
V = var (A, w)
V = var (A, w, dim)
V = var (A, w, vecdim)
V = var (A, w, "all")
V = var (..., nanflag)
[V, M] = var (...)

Variance of the elements of A along a dimension.  W is 0 (default,
normalise by N-1), 1 (normalise by N) or a vector of non-negative
weights.  DIM, a vector of dimensions VECDIM or "all" select the
elements that make up each sample.  NANFLAG is "includenan"/
"includemissing" (default) or "omitnan"/"omitmissing".  The second
output M is the (weighted) mean over the same elements.  Complex
input gives a real variance.