15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Interpolation<br />

7 Compare the contour plots for the different interpolation methods.<br />

3<br />

3<br />

3<br />

2<br />

2<br />

2<br />

1<br />

1<br />

1<br />

0<br />

0<br />

0<br />

−1<br />

−1<br />

−1<br />

−2<br />

−2<br />

−2<br />

−3<br />

−3 −2 −1 0 1 2 3<br />

−3<br />

−3 −2 −1 0 1 2 3<br />

−3<br />

−3 −2 −1 0 1 2 3<br />

contour(xi,yi,zi1)<br />

% nearest<br />

contour(xi,yi,zi2)<br />

% bilinear<br />

contour(xi,yi,zi3)<br />

% bicubic<br />

Notice that the bicubic method, in particular, produces smoother contours.<br />

This is not always the primary concern, however. For some applications, such<br />

as medical image processing, a method like nearest neighbor may be preferred<br />

because it doesn’t generate any “new” data values.<br />

Interpolation and Multidimensional Arrays<br />

Several interpolation functions operate specifically on multidimensional data.<br />

Interpolation Functions for Multidimensional Data<br />

Function<br />

interp3<br />

interpn<br />

ndgrid<br />

Description<br />

Three-dimensional data interpolation.<br />

Multidimensional data interpolation.<br />

Multidimensional data gridding (elmat directory).<br />

This section discusses<br />

• Interpolation <strong>of</strong> three-dimensional data<br />

• Interpolation <strong>of</strong> higher dimensional data<br />

• Multidimensional data gridding<br />

2-15

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

Saved successfully!

Ooh no, something went wrong!