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 #33813 is a reply to message #33713] Fri, 24 January 2003 07:50 Go to previous messageGo to previous message
Pepijn Kenter is currently offline  Pepijn Kenter
Messages: 31
Registered: April 2002
Member
"Kenneth Bowman" <k-bowman@null.tamu.edu> wrote in message
news:k-bowman-4D0582.08381824012003@news.tamu.edu...
> 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

Thanks, but what I actually meant was a way where you can replace the mean
function by any, arbitrary function.
I forgot about the dimension parameter of the TOTAL function, so my example
was a bad one. Sorry.

Pepijn.
[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:05:18 PDT 2025

Total time taken to generate the page: 0.00421 seconds