Re: Sum to Arrays [message #4235] |
Thu, 11 May 1995 00:00 |
Fergus Gallagher
Messages: 41 Registered: January 1995
|
Member |
|
|
phrje@csv.warwick.ac.uk (Prof. Don McK Paul) wrote:
> We wish to e.g. sum the columns of a 2d array and store the results in a
> 1d array. Is there any way to accomplish this without using FOR loops.
>
> Don
The total function has an optional second argument, the dimension to sum
over, e.g.,
IDL> x = total(y,2)
sums over the second dimension of y and returns a vector equal in length
to the first dimension of y.
Fergus
=================================================
| Fergus Gallagher |
| Remote Sensing Applications Development Unit |
| British National Space Centre |
| Monks Wood |
| Huntingdon PE17 2LS / UK |
| |
| F.Gallagher@nerc.ac.uk |
| http://uh.nmt.ac.uk/bnsc/fgg.html |
=================================================
|
|
|
Re: Sum to Arrays [message #4236 is a reply to message #4235] |
Thu, 11 May 1995 00:00  |
Fergus Gallagher
Messages: 41 Registered: January 1995
|
Member |
|
|
phrje@csv.warwick.ac.uk (Prof. Don McK Paul) wrote:
> We wish to e.g. sum the columns of a 2d array and store the results in a
> 1d array. Is there any way to accomplish this without using FOR loops.
>
> Don
The total function has an optional second argument, the dimension to sum
over, e.g.,
IDL> x = total(y,2)
sums over the second dimension of y and returns a vector equal in length
to the first dimension of y.
Fergus
=================================================
| Fergus Gallagher |
| Remote Sensing Applications Development Unit |
| British National Space Centre |
| Monks Wood |
| Huntingdon PE17 2LS / UK |
| |
| F.Gallagher@nerc.ac.uk |
| http://uh.nmt.ac.uk/bnsc/fgg.html |
=================================================
|
|
|