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

Home » Public Forums » archive » Adding 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
Re: Adding arrays [message #91474 is a reply to message #91473] Fri, 17 July 2015 11:36 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Dete van Eeden writes:
>
>> How do I define an array that consists of 5 arrays each with 256x256 elements?
>>
>> For example final(k) is the sum of the arrays from 1 to 5 and final=fltarr(256,256)
>>
>> It seems so simple but I cant get it right :-)
>
> total = FltArr(256,256)
> data = FltArr(256, 256, 5)
> FOR j=0,4 do total = Temporary(total) + data[*,*,j]

Or, the IDL Way:

data = Randomu(seed, 256,256,5)
total = Total(data, 3)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: creating arrays in loops
Next Topic: Creating KML error

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

Current Time: Wed Oct 08 13:35:45 PDT 2025

Total time taken to generate the page: 0.00342 seconds