sum

From DavinciWiki
Jump to: navigation, search


Description

Compute a sum along a specified axis

Arguments and Return Values

Arguments: a numeric array and an axis

Return Value: a numeric array containing the sum of the input

Usage

Syntax: sum(object = VAL, axis = [x][y][z])

The sum() function computes the sum of values along one or more axis. If no axis is specified, then all the summation is performed along all three axis. Sum always returns a DOUBLE.

Examples

dv> a   
3x4x1 array of float, bsq format [48 bytes]
1.89930 4.62761 3.03009
7.49250 1.37870 9.20843
5.94351 1.72753 1.19441
8.40242 1.17997 4.59570

dv> sum(a,axis=x)
1x4x1 array of double, bsq format [32 bytes]
9.55700
18.0796
8.86545
14.1781

dv> sum(a,y)
3x1x1 array of double, bsq format [24 bytes]
23.7377 8.91380 18.0286

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: 11-19-2009

Personal tools