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

Home » Public Forums » archive » indexing arrays with 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
indexing arrays with arrays [message #55222] Tue, 07 August 2007 06:39 Go to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
It seems to me that a highly useful syntax for IDL would be something
like this:

res = randomu(seed,10)
start_ind = indgen(5)
end_ind = start_ind + 1

extract = res[start_ind:end_ind]

In this case, I would envision extract being a 10 element array.
Namely, it would be the equivelent of:

extract = [res[start_ind[0]:end_ind[0]], res[start_ind[1]:end_ind[1]],
res[start_ind[2]:end_ind[2]], etc...]

Does anyone else think something like this would be useful? Anyone
know how I can bug RSI and request something like this? I couldn't
find a "feature request" option, or anything similar, on their site.
Anyway, that point aside, can anyone think of a robust way to do this
right now? I've been trying to come up with a speedy, robust, for-
loop-less way to do this, but haven't come up with anything. Any
thoughts would be appreciated.
[Message index]
 
Read Message
Read Message
Previous Topic: Structure Containing Structure: question about parentheses
Next Topic: Thinning algorithm without for loops

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

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

Total time taken to generate the page: 0.00430 seconds