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

Home » Public Forums » archive » Variable stride in array indices
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: Variable stride in array indices [message #15460 is a reply to message #15249] Tue, 18 May 1999 00:00 Go to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <ySg03.87161$A6.43176220@news1.teleport.com>, "DBorland"
<dborland@egi.com> wrote:

> IDL> a[(a[*,2*LINDGEN(3)])[2*LINDGEN(3),*]] = -1
>
> When you do this, the values from above are set to -1
> IDL> print,a
> -1 1 -1 3 -1 5
> 6 7 8 9 10 11
> -1 13 -1 15 -1 17
> 18 19 20 21 22 23
> -1 25 -1 27 -1 29
> 30 31 32 33 34 35

This only works because the original array was created with LINDGEN. It
won't work in the general case.

I still like

a[0:*:2,0:*:2] = -1

for aesthetic reasons alone.

Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL Program Updates
Next Topic: divide by zero problems

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

Current Time: Sat Oct 11 12:56:19 PDT 2025

Total time taken to generate the page: 1.44015 seconds