Re: interpolation question [message #48459 is a reply to message #25895] |
Mon, 24 April 2006 11:35   |
chen123.dian
Messages: 4 Registered: April 2006
|
Junior Member |
|
|
Hi,
Thanks so much for all suggestions here.
I am so wonder that why IDL has no simple function like MATLAB's
'interp2'. Another problem is for value_locate. Some suggestions
mentioned to use value_locate. Here is a example to show my problem.
IDL> vec = [2.0, 5.0, 8.0, 10.0]
IDL> print, vec
2.00000 5.00000 8.00000 10.0000
IDL> loc = VALUE_LOCATE(vec, [0.0, 4.5, 5.0, 6.0, 12.0])
IDL> print, loc
-1 0 1 1 3
We can see the value of "4.5" corresponds to index location of "0".
Actually, the value of "4.5" should correspond to index location of "1"
because the value of "4.5" is closer to the value of "5.0" having index
location of "1".
Thanks.
Regards,
Chen
|
|
|