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

Home » Public Forums » archive » Re: elegant array index expansion using INTERPOLATE
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: elegant array index expansion using INTERPOLATE [message #58048 is a reply to message #58045] Fri, 11 January 2008 12:45 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jan 11, 2:33 pm, "Ryan." <rchug...@brutus.uwaterloo.ca> wrote:
> Hi All,
>
> If I have a range of array indices I want to be able to interpolate
> between this to get all indices in between. What is an elegant way of
> doing this?
>
> Here is an example of what I want:
>
> array = [0,2,4,6,8,10,12,14,16,18]
> idxrange = [3, 6]
>
> expidxrange = Interpolate('idxrange') to get [3,4,5,6]
>
> so that I can get
> array[expidxrange] OR [6,8,10,12]
>
> I would like it to be as general as possible. This is what I have, but
> it doesn't work for a range of 1:
>
> expidxrange = INTERPOLATE(idx, $
> (1./(idxrange[1]-idxrange[0])*FINDGEN(idxrange[1]-idxrange[0 ]) ) )
>
> Any thoughts?
>
> Ryan.

Do you want:

expidxrange = lindgen(idxrange[1]-idxrange[0]+1)+idxrange[0]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: combinatorial annealing
Next Topic: image on map

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

Current Time: Fri Oct 10 14:02:10 PDT 2025

Total time taken to generate the page: 0.00635 seconds