Documentation Center

  • Trial Software
  • Product Updates


Piecewise Cubic Hermite Interpolating Polynomial (PCHIP)


yi = pchip(x,y,xi)
pp = pchip(x,y)


yi = pchip(x,y,xi) returns vector yi containing elements corresponding to the elements of xi and determined by piecewise cubic interpolation within vectors x and y. The vector x specifies the points at which the data y is given. If y is a matrix, then the interpolation is performed for each column of y and yi is length(xi)-by-size(y,2).


pchip finds values of an underlying interpolating function at intermediate points, such that:

  • On each subinterval , is the cubic Hermite interpolant to the given values and certain slopes at the two endpoints.

  • interpolates y, i.e., , and the first derivative is continuous. is probably not continuous; there may be jumps at the .




expand all

Data Interpolation Using spline and pchip

x = -3:3;
t = -3:.01:3;
p = pchip(x,y,t);
s = spline(x,y,t);

More About

expand all



  • spline produces a smoother result, i.e. is continuous.



  • pchip is less expensive to set up.

  • The two are equally expensive to evaluate.




See Also

| |

Was this topic helpful?