Home > freetb4matlab > NaN > var.m

var

PURPOSE ^

VAR calculates the variance.

SYNOPSIS ^

function y=var(x,opt,DIM,W)

DESCRIPTION ^

 VAR calculates the variance.
 
 y = var(x [, opt[, DIM]])
   calculates the variance in dimension DIM
   the default DIM is the first non-single dimension

 opt   0: normalizes with N-1 [default]
    1: normalizes with N 
 DIM    dimension
    1: VAR of columns
    2: VAR of rows
     N: VAR of  N-th dimension 
    default or []: first DIMENSION, with more than 1 element
 W    weights to compute weighted variance (default: [])
    if W=[], all weights are 1. 
    number of elements in W must match size(x,DIM) 
 
 error: 
    var(x)    
    var(x, opt, DIM)    
    var(x, [], DIM)    
    var(x, W, DIM)
    var(x, opt, DIM, W)    

 features:
 - can deal with NaN's (missing values)
 - weighting of data 
 - dimension argument 
 - compatible to Matlab and Octave

 see also: MEANSQ, SUMSQ, SUMSKIPNAN, MEAN, RMS, STD,

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003