15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Polynomials and Interpolation<br />

Interpolation Function Summary (Continued)<br />

Function<br />

interpn<br />

mkpp<br />

pchip<br />

ppval<br />

spline<br />

unmkpp<br />

Description<br />

N-dimensional interpolation (table lookup).<br />

Make a piecewise polynomial<br />

Piecewise Cubic Hermite Interpolating Polynomial<br />

(PCHIP).<br />

Piecewise polynomial evaluation<br />

Cubic spline data interpolation<br />

Piecewise polynomial details<br />

One-Dimensional Interpolation<br />

There are two kinds <strong>of</strong> one-dimensional interpolation in <strong>MATLAB</strong>:<br />

• Polynomial interpolation<br />

• FFT-based interpolation<br />

Polynomial Interpolation<br />

The function interp1 performs one-dimensional interpolation, an important<br />

operation for data analysis and curve fitting. This function uses polynomial<br />

techniques, fitting the supplied data with polynomial functions between data<br />

points and evaluating the appropriate function at the desired interpolation<br />

points. Its most general form is<br />

yi = interp1(x,y,xi,method)<br />

y is a vector containing the values <strong>of</strong> a function, and x is a vector <strong>of</strong> the same<br />

length containing the points for which the values in y are given. xi is a vector<br />

containing the points at which to interpolate. method is an optional string<br />

specifying an interpolation method:<br />

• Nearest neighbor interpolation (method = 'nearest'). This method sets the<br />

value <strong>of</strong> an interpolated point to the value <strong>of</strong> the nearest existing data point.<br />

• Linear interpolation (method = 'linear'). This method fits a different linear<br />

function between each pair <strong>of</strong> existing data points, and returns the value <strong>of</strong><br />

2-10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!