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 #15451 is a reply to message #15249] Tue, 18 May 1999 00:00 Go to previous messageGo to previous message
DBorland is currently offline  DBorland
Messages: 10
Registered: March 1999
Junior Member
----------
In article <bowman-1805990954070001@bowman.tamu.edu>, bowman@null.edu
(Kenneth P. Bowman) wrote:

> I had a chance to look at my code to see if Liam's suggestion would work,
> and I realized that it won't, because I need to use the variable stride on
> the *left* side of the equal sign, i.e.
>
> IDL> a = LINDGEN(6,6)
> IDL> print, a
> 0 1 2 3 4 5
> 6 7 8 9 10 11
> 12 13 14 15 16 17
> 18 19 20 21 22 23
> 24 25 26 27 28 29
> 30 31 32 33 34 35
> IDL> print, (a[*,2*LINDGEN(3)])[2*LINDGEN(3),*]
> 0 2 4
> 12 14 16
> 24 26 28


What you need to do it then sent the results here as the index for the
array. ie:

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



David Borland
Software Engineer
Electrical Geodesics, Inc.
[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: Fri Oct 10 15:28:26 PDT 2025

Total time taken to generate the page: 1.60286 seconds