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

Home » Public Forums » archive » subscribing 3D 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: subscribing 3D arrays [message #17273 is a reply to message #17135] Thu, 16 September 1999 00:00 Go to previous messageGo to previous message
fireman is currently offline  fireman
Messages: 49
Registered: August 1991
Member
Tom Wassenaar (wassenaa@ensam.inra.fr) wrote:
: I can't figure out how to directly subscribe a group of individual cells
: in one layer of a 3D array.

: b = indgen(3,3,3)
: b[[1,2],[2,1],0] = 0
: print, b[*,*,0]

: 0 1 2
: 3 0 0
: 6 0 0

Tom -

Combining subscript arrays and scalars is not as obvious as it seems!
In fact your 2-d example worked only because of the particular subscripts
you chose. See the IDL Manual, Combining Array Subscripts with Others.
I would stick with explicit point reference, as follows:

IDL> b[[1,2,0],[2,1,0]] = 0
IDL> print, b[*,*,0]
0 1 2
3 4 0
6 0 8

Good luck,
Gwyn


--
-- Gwyn F. Fireman
-- General Sciences Corporation / MODIS Characterization Support Team
-- Gwyn.Fireman@gsfc.nasa.gov 301-352-2118
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Filling an outline
Next Topic: Re: IDL and TCL interaction

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

Current Time: Wed Oct 08 18:12:07 PDT 2025

Total time taken to generate the page: 0.00204 seconds