OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

interp1

Contents

Menu Information

Interpolate/Extrapolate Y from X

Brief Information

Perform 1D interpolation or extrapolation on a group of XY data to find Y at given X values using 3 alternative methods.

Command Line Usage

1. interp1 ix:=Col(3) iy:=(Col(1), Col(2));

2. interp1 ix:=Col(3) iy:=Col(2) ox:=Col(4);

3. interp1 ix:=Col(3) iy:= Col(2) method:= bspline coef:=Col(4);

4. interp1 ix:=Col(3) iy:=(Col(1), Col(2)) method:=spline;

5. interp1 ix:=Col(3) iy:=Col(2) method:=spline ox:=<new> coef:=<new>;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
X Values to Interpolate ix

Input

vector

<unassigned>
The vector to interpolate on.
Input iy

Input

XYRange

<active>
The XY range to be interpolated.
Method method

Input

int

linear
Interpolation methods

Option list:

  • linear:Linear
method:=0, Linear interpolation is a fast method of estimating a data point by constructing a line between two neighboring data points. The resulting point may not be an accurate estimation of the missing data.
  • spline:Cubic Spline
method:=1, This method splits the input data into a given number of pieces, and fits each segment with a cubic polynomial. The second derivative of each cubic function is set equal to zero. With these boundary conditions met, an entire function can be constructed in a piece-wise manner.
  • bspline:Cubic B-Spline
method:=2, This method also splits the input data into pieces, each segment is fitted with discrete Bezier splines.
Boundary boundary

Input

int

notaknot
Boundary condition only available in cubic spline method

Option list:

  • natural:Natural
2nd derivatives are 0 on both end
  • notaknot:Not-A-Knot
3rd derivatives are continuous on the second and last-second point
Smoothing Factor sf

Input

double

0
A non-negative parameter that specifies the smoothness of the interpolated curve in Cubic B-Spline interpolation. The factor helps user control the balance between the smoothing and closeness. Larger values will result in smoother curves.
Result of interpolation ox

Output

vector

<new>
The output vector interpolated on ix.
Coefficients coef

Output

vector

<optional>
Spline coefficients when using spline or B-spline method.


Examples

1. Import Interpolation.dat on \Samples\Mathematics folder.

2. Highlight column B and click Analysis: Mathematics: Interpolate/Extrapolate Y from X on the menu to bring up the dialog.

3. Now the Input branch have filled with proper data range, click the drop-down list beside X Values to Interpolate edit box, and select Col(C).

4. Select Cubic B-spline interpolate method.

5. Click OK to do interpolation.


More Information

Please refer to this page in the User Guide for more information:

Related X-Functions

interp1xy, interp1q, spline, bspline, minterp2