<< pburg | FOSSEE_Signal_Processing_Toolbox | pchips >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > pchip

# pchip

Compute the piecewise cubic Hermite interpolating polynomial.

### Syntax

    v = pchip(x, y)
    v = pchip(x, y, xx)

### Parameters

x:

  A vector of input data points.

y:

  A vector or matrix of function values at the points in `x`. If `y` is a vector, it must have the same length as `x`. If `y` is a matrix, the last dimension of `y` must equal the length of `x`.

xx:

  (optional) Points for interpolation.

### Description

The `pchip` function computes the piecewise cubic Hermite interpolating polynomial for the given data points `x` and `y`. If the optional parameter `xx` is provided, the function evaluates the interpolating polynomial at the points in `xx`.

### Examples

    x = [0, 1, 2, 3, 4, 5]
    y = [1, 0, 1, 0, 1, 0]
    xx = linspace(0, 5, 800)
    v1 = pchip(x, y)
    v2 = pchip(x, y, xx)
    plot(x, y, 'o', xx, v2)

### Authors

- Jitendra Singh

Report an issue
<< pburg | FOSSEE_Signal_Processing_Toolbox | pchips >>