Home > NaN > mean.m

mean

PURPOSE ^

MEAN calculates the mean of data elements.

SYNOPSIS ^

function [y]=mean(x,DIM,opt,W)

DESCRIPTION ^

 MEAN calculates the mean of data elements. 
 
  y = mean(x [,DIM] [,opt] [, W])

 DIM    dimension
    1 MEAN of columns
    2 MEAN of rows
     N MEAN of  N-th dimension 
    default or []: first DIMENSION, with more than 1 element

 opt    options 
    'A' arithmetic mean
    'G' geometric mean
    'H' harmonic mean

 W    weights to compute weighted mean (default: [])
    if W=[], all weights are 1. 
    number of elements in W must match size(x,DIM) 

 usage: 
    mean(x)
    mean(x,DIM)
    mean(x,opt)
    mean(x,opt,DIM)
    mean(x,DIM,opt)
    mean(x,DIM,W)
    mean(x,DIM,opt,W); '

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

 see also: SUMSKIPNAN, MEAN, GEOMEAN, HARMMEAN

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:02:45 by m2html © 2003