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

Home » Public Forums » archive » confused multiplying arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
confused multiplying arrays [message #73482] Thu, 11 November 2010 13:11 Go to previous message
paulartcoelho is currently offline  paulartcoelho
Messages: 30
Registered: March 2007
Member
hello,

i've got two arrays:

IDL> help,area,fluxes
AREA FLOAT = Array[2000]
FLUXES FLOAT = Array[2000, 112864]

I want the i-th element in area AREA[i] to multiply all elements in
the corresponding 2nd dimension in fluxes FLUXES[i,*] and then sum up
all the 2000 resulting fluxes, i.e., using loop:

for i = 0,1999 do begin
TOTAL_FLUX = TOTAL_FLUX + AREA[i]*reform(FLUXES[i,*])
endfor

i've been trying to figure out (without success) how to compute
TOTAL_FLUX without the loop using TOTAL(). ideas?

thx
p.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Good-bye Contour Command
Next Topic: Alternative to cell_fill?

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

Current Time: Sun Oct 12 16:31:58 PDT 2025

Total time taken to generate the page: 0.01305 seconds