About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/cumsum.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 cumsum Context: slangrtl

Synopsis

Compute the cumulative sum of an array

Syntax

result = cumsum (Array_Type a [, Int_Type dim])

Description

The cumsum function performs a cumulative sum over the elements of a numeric array and returns the resulting. If a second argument is given, then it specifies the dimension of the array to be summed over. For example, the cumulative sum of [1,2,3,4], is the array [1,1+2,1+2+3,1+2+3+4], i.e., [1,3,6,10].

CHANGES IN CIAO 3.1

The cumsum function is now available to S-Lang code evaluated by ChIPS and Sherpa. Prior to CIAO 3.1 it was only available to code evaluated by slsh.

See Also

slangrtl
max, min, sum, transpose
Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.