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

Home » Public Forums » archive » Interpolation question
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: interpolation question [message #48394 is a reply to message #25895] Thu, 20 April 2006 01:20 Go to previous messageGo to previous message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Hi Chen,

I haven't tested this extensively, but I would try

nn = y[round(interpol(indgen(n_elements(x)),x, u))]

where "x" and "y" are the, well, x and y values and "u" is the vector
with x-values for which the nearest neighbours are to be found.

What goes on?

The interpol command interpolates the indices of the x and y vectors to
the new locations, round actually finds the nearest neighbour in terms
of index, and then we just assign y with those indices.

Regards,

Peter
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Length of command line input
Next Topic: ellipsoid 3D

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

Current Time: Fri Oct 10 12:06:45 PDT 2025

Total time taken to generate the page: 0.03133 seconds