comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » simple array math question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: simple array math question [message #33814 is a reply to message #33713] Fri, 24 January 2003 06:38 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <b0rce6$23c$1@news.surfnet.nl>,
"Pepijn Kenter" <kenter@tpd.tno.nl> wrote:

> And does any IDL-wizard know a similar trick to average each row/column of
> a?
> i.e. to replace the following lines:
>
> result = dblarr(3)
> for i = 0, 2 do result[i] = mean(a[*,i])

That's an easy one:

result1 = TOTAL(a, 1, /DOUBLE)/n1
result2 = TOTAL(a, 2, /DOUBLE)/n2

where n1 and n2 are the sizes of the first and second dimensions,
respectively.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Polyfill, z-buffer & postscript
Next Topic: True size of a gzip compressed file?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:07:16 PDT 2025

Total time taken to generate the page: 0.00381 seconds