Re: connect the dots . . . A question [message #33819] |
Mon, 03 February 2003 18:19 |
Pete[2]
Messages: 3 Registered: February 2003
|
Junior Member |
|
|
Hi Sean,
The interpol function almost does what you want:
values = [10,20,30,20]
indexes = [2,4,6,10]
x_index = indgen(12)
myFullArray=interpol(values,indexes,x_index)
myFullArray then equals [0 5 10 15 20 25 30 28 25 23 20 18]
Cheers,
Peter
"Sean Raffuse" <sean@me.wustl.edu> wrote in message
news:b1n4mu$t5p$1@newsreader.wustl.edu...
> Hello venerable newsgroup.
>
> I have an algorithmic question.
>
> I'd like to interpolate values for everywhere in an array that I don't
have
> data. e.g.
>
> myFullArray = intarr(12)
> values = [10,20,30,20] ;the values I do have
> indexes = [2,4,6,10] ;the locations associated with these values
>
> In other words, I want to turn this [?,?,10,?,20,?,30,?,?,?,20,?]
>
> into this [10,10,10,15,20,25,30,28,25,23,20,20]
>
> Any thoughts?
>
> Thanks in advance,
>
> Sean
>
>
|
|
|