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

Home » Public Forums » archive » Pasting subarray into array with compound assignment
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Pasting subarray into array with compound assignment [message #53630] Thu, 19 April 2007 17:37
m.avdeev@gmail.com is currently offline  m.avdeev@gmail.com
Messages: 2
Registered: April 2007
Junior Member
i'm trying to use the advantage of "+=" when reshaping 2d array to 1d

Can anyone tell me why the following produce different values?
(difference in shape and type of the results is not a problem)

a1=indgen(3,7) & for i=0,2 do a2[0,i*2]+=a1[i,*] & print,a2

a1=indgen(3,7) & a2=intarr(3,11) & for i=0,2 do a2[i,i*2]=a1[i,*] &
a2=total(a2,1) & print,a2

thanks,
max
[Message index]
 
Read Message
Previous Topic: compile_opt for double?
Next Topic: sparsab, sparsax and complex arrays

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

Current Time: Fri Oct 10 03:37:22 PDT 2025

Total time taken to generate the page: 1.36107 seconds