avg

From DavinciWiki
Revision as of 18:18, 15 February 2006 by Keith (Talk | contribs)

Jump to: navigation, search


64-bit SafeYes

Description

The avg() function computes the statistical average along one or more axis. If no axis is specified, then the average is computed along all three.

Arguments and Return Values

avg() always returns a DOUBLE.

Usage

If an ignore value is specified, then any element that is equal to the ignore value is not included in the computation. If all the values in the computation are equal to the ignore value, then the output is set to the ignore value.

If the both flag is set (both=1), then avg returns a structure containing the both the avg and stddev.

Note: The avg function uses a one-pass accumulator that can experience round off error with lots of numbers.

Examples

 dv> a
 3x3x1 array of float, bsq format [36 bytes]
 0.296204        0.512341        0.0492002
 0.914697        0.319797        0.274103
 0.875370        0.896324        0.00839178

 dv> avg(a)
 0.460714

 dv> avg(a,axis=y)
 3x1x1 array of double, bsq format [24 bytes]
 0.695424        0.576154        0.110565

 dv> avg(a,axis=x)
 1x3x1 array of double, bsq format [24 bytes]
 0.285915
 0.502866
 0.593362

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left


Recent Core Changes

Modified On: 12-05-2010

Personal tools