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

Home » Public Forums » archive » HELP 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: HELP adding arrays [message #91537 is a reply to message #91536] Sun, 26 July 2015 10:41 Go to previous messageGo to previous message
dg86 is currently offline  dg86
Messages: 118
Registered: September 2012
Senior Member
On Sunday, July 26, 2015 at 11:30:16 AM UTC-4, Dete van Eeden wrote:
> Hallo
>
> I have posted before but I still cant add arrays together!
>
> I have tried the total command:
>
> finaal=fltarr(1508)
> values=fltarr(1508,6)
>
> finaal=total(values,2)
>
> finaal is equal to the last array...
>
> I have also tried
>
> finaal=fltarr(1508)
> values=fltarr(1508,6)
>
> finaal=temporary(finaal) + values[*,j]
>
> finaal is Still equal to the last array
>
> What the hell?!
>
> It cant be that difficult......

Your "values" all have the value zero. The sum is working, but you're
only adding up the value zero. Try this ...

IDL> values = findgen(5, 6) ; create a small index array for demo
IDL> finaal = total(values, 2) ; sum over the second dimension
IDL> print, finaal
75.000000 81.000000 87.000000 93.000000 99.000000

It works!

All the best,

David
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Current color table
Next Topic: cgsymbols change when saving from cgwindow to pdf

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

Current Time: Wed Oct 08 16:02:29 PDT 2025

Total time taken to generate the page: 0.00241 seconds