ABSTRACT

Data interpolation means to use a given set of n + 1 data points to approximate a function f(x) by a polynomial P n (x) = a n x n + a n−1 x n−1 + … + a 1 x + a 0 (of degree not exceeding n), such that P n (x i ) = f(x i ), i = 0, …, n, where a 0, …, a n are constants. The data points are given by the table: x x 0 x 1 … x n f(x) f(x 0) f(x 1) … f(x n ) where x i ≠ x j for i ≠ j and x 0 < x 1 … < x n.

This chapter discusses some of the interpolation methods and their implementation in MATLAB® and Python. It is divided into four sections. Section 1 discusses Lagrange interpolation and its implementation in MATLAB and Python. Section 2 discusses Newton’s interpolation and the divided difference technique for finding the coefficients of Newton’s interpolation. One-dimensional interpolations with MATLAB and Python are discussed in Sections 3 and 4.