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

Home » Public Forums » archive » Re: replacing blocks in an array with other array values?
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: replacing blocks in an array with other array values? [message #78819 is a reply to message #78818] Sun, 25 December 2011 15:43 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Dec 25, 7:11 pm, Ecaterina Coman <ecatc...@umbc.edu> wrote:
> hi guys,
> I have a 4*4 array, for example, and i want to replace the center 2*2
> block of an array with the values in another array
>
> lets say A is 4*4
> and B is 2*2
> I tried doing A[1:2,1:2]=B but it doesn't change anything in A

Really?

IDL> a=bindgen(4,4)
IDL> b=100+bindgen(2,2)
IDL> print,a
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
IDL> print,b
100 101
102 103
IDL> a[1:2,1:2]=b
IDL> print,a
0 1 2 3
4 100 101 7
8 102 103 11
12 13 14 15
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: replacing blocks in an array with other array values?
Next Topic: Array Subscription

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

Current Time: Wed Oct 08 19:18:30 PDT 2025

Total time taken to generate the page: 0.00453 seconds