Graphics Reference
In-Depth Information
6.2 Interpolation and Polynomial Fit
MATLAB provides several commands for polynomial interpolation and adjustment curves that we will study below:
polyfit(x, y, n) gives the vector of coefficients of the polynomial in x, p(x) of degree n that
best fits the data (xi, yi) in the least squares sense (p(xi) = yi).
Yí = interp1(X,Y,Xi, 'method') gives the vector Yi such that (Xi, Yi) is the total set of points
found by interpolation between the given points (X, Y). The option method can take the
value linear , spline , or cubic , depending on whether the interpolation is linear (default
option), staggered or cubic ( Xi points uniformly separated). This is for interpolation in one
dimension.
Zi = interp2(X,Y,Z,Xi,Yi, 'method') gives Zi where (Xi, Yi, Zi) is the total set of points found
by interpolation between the given points (X, Y, Z). The option method can take the value
linear or cubic , depending on whether the interpolation is linear (option by default) or
cubic ( Xi points uniformly separated). This is for two-dimensional interpolation.
Zi = griddata(X,Y,Z,Xi,Yi) gives the vector Zi that determines the interpolation points
(Xi, Yi, Zi) between the given points (X, Y, Z). A method of inverse distance is used to
interpolate.
Y = interpft(X,n) gives the vector Y uses the values of the periodic function X sampled at n
equally spaced points. The original vector x is transformed to the domain of frequencies of a
Fourier transform using the Fast Fourier transform (FFT algorithm). Valid for n ≥ length (X).
maple('interp([exprx 1 ,…,exprx n+1 ], [expry 1 ,…,expry n+1 ],variable)') gives a polynomial
in the specified variable of degree at least n that represents the interpoltion polynomial for
points from [exprx 1 , expry 1 ] to [exprxexpry n + 1n + 1 ]. The coordinates of the points all have to
be different.
maple('Interp([exprx 1 ,…,exprx n+1 ], [expry 1 ,…,expry n+1 ], variable)') in inert mode, is a
polynomial in the specified variable of degree at least n that represents the interpolation
polynomial for points from [exprx 1 , expry 1 ] to [exprx n + 1 expry n + 1 ]. The coordinates of the
points all have to be different.
maple('Interp([exprx 1 ,…,exprx n+1 ], [expry 1 ,…,expry n+1 ], variable) mod n') in inert mode
Module- n, is a polynomial in the specified variable of degree at least n that represents
the interpolation polynomial for points from [exprx 1 , expry 1 ] to [exprx n + 1 expry n + 1 ]. The
coordinates of the points all have to be different.
maple('readlib (thiele): thiele([exprx1,…,exprxn],[expry1,…,expryn],variable)') finds
an expression in the given variable that represents the entire function resulting in the Thiele
interpolation points (exprxi, expryi) for i = 1… n.
 
Search WWH ::




Custom Search