avg

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
m (Avg moved to avg)
Line 5: Line 5:
 
Return Value: avg() always returns a DOUBLE array.
 
Return Value: avg() always returns a DOUBLE array.
 
|
 
|
 +
[[Syntax]]: avg(object = VAL [, axis = OPTION] [, both = 1] [, ignore = VAL])
 
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 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.
 
   
 
   
Line 39: Line 40:
  
 
}}
 
}}
[[category:Davinci Core]]
 
 
[[category:Functions]]
 
[[category:Functions]]
 +
[[category:Davinci Core]]
 
[[category:Math]]
 
[[category:Math]]

Revision as of 10:17, 23 March 2006



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

Arguments: An array of any numeric type and organization, and an axis along which to compute the average. Return Value: avg() always returns a DOUBLE array.

Usage

Syntax: avg(object = VAL [, axis = OPTION] [, both = 1] [, ignore = VAL]) 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

Related Functions

Recent Core Changes

Modified On: 12-05-2010

Personal tools