[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem array subscripting
- Subject: Re: Problem array subscripting
- From: davidf(at)dfanning.com (David Fanning)
- Date: Tue, 17 Aug 1999 18:32:44 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <37B7FF76.F5062466@etsit.upm.es> <37B9E48A.B5829D9B@llnl.gov>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:16163
Henry Chapman (chapman9@llnl.gov) writes:
> This can be solved with a little trick I posted awhile back (some time
> after a long thread about indices). The trick is to index an extra
> dimension.
>
> Example:
>
> IDL> array = bindgen(16,16,5)
> IDL> index = indgen(5)
> IDL> x = [0,1,2]
> IDL> y = [8,9,10,11]
>
> IDL> result = array[x, y, index, 0]
The trouble with this trick is that I don't understand
how it works. It's fine for production code, don't get
me wrong, where a little smoke and mirrors can even be
elegant. I just don't want to get up in front of an IDL
programming class and have to explain it. Do you have
any theories?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155