
ArgumentsĪn input vector of any type except string. The result is a single- or double-precision floating-point vector, or a complex vector if the input vector is complex. Result = INTERPOL( V, X, XOUT ) Return Value p = PLOT(x, y, COLOR= 'red', NAME= 'Original data', $ TITLE= 'INTERPOL example') q = SCATTERPLOT(xinterp, result, SYMBOL= 'square', /OVERPLOT, $ NAME= 'Interpolated values') lgd = LEGEND(POSITION=, /DATA, SHADOW= 0, LINESTYLE= 'none') Syntax

result = INTERPOL(y, x, xinterp) Plot the original sine wave and the interpolated values. xinterp = RANDOMU( 1, 10)* 6 - 3 Interpolate. Make a sine wave on the interval x = FINDGEN( 61)/ 10 - 3 y = SIN(x) Define a set of 10 locations where interpolates are desired. ExamplesĬreate a floating-point vector of 61 elements in the range. Its source code can be found in the file interpol.pro in the lib subdirectory of the IDL distribution. This routine is written in the IDL language. Note: The INTERPOL function automatically detects any NaN values in your input data, and excludes these values when computing the interpolation.

The INTERPOL function performs linear, quadratic, or spline interpolation on vectors with a regular or irregular grid.
