calculates the variance.
y=nan_var(x) y=nan_var(x, opt, DIM) y=nan_var(x, [], DIM) y=nan_var(x, W, DIM) y=nan_var(x, opt, DIM, W)
0: normalizes with N-1 [default]
normalizes with N
dimension
VAR of columns
VAR of rows
VAR of N-th dimension
first DIMENSION, with more than 1 element
weights to compute weighted variance (default: [])
variance in dimension DIM, the default DIM is the first non-single dimension
features: - can deal with NaN's (missing values) - weighting of data - dimension argument - compatible to Matlab and Octave
X=testmatrix('magi',3) X([1 6:9]) = %nan*ones(1,5); X = Nan 1. Nan 3. 5. Nan 4. Nan Nan y = nan_var(X) y = 0.5 8. Nan | ![]() | ![]() |