28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

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.

interp1<br />

2-1190<br />

yi = interp1(x,Y,xi,method,extrapval) returns the scalar extrapval for<br />

out of range values. NaN and 0 are often used for extrapval.<br />

pp = interp1(x,Y,method,'pp') uses the specified method to generate the<br />

piecewise polynomial form (ppform) of Y. You can use any of the methods in the<br />

preceding table, except for 'v5cubic'.<br />

The interp1 command interpolates between data points. It finds values at<br />

intermediate points, of a one-dimensional function fx ( ) that underlies the<br />

data. This function is shown below, along with the relationship between vectors<br />

x, Y, xi, and yi.<br />

f(x)<br />

Interpolation is the same operation as table lookup. Described in table lookup<br />

terms, the table is [x,Y] and interp1 looks up the elements of xi in x, and,<br />

based upon their locations, returns values yi interpolated within the elements<br />

of Y.<br />

Note interp1q is quicker than interp1 on non-uniformly spaced data<br />

because it does no input checking. For interp1q to work properly, x must be a<br />

monotonically increasing column vector and Y must be a column vector or<br />

matrix with length(X) rows. Type help interp1q at the command line for<br />

more information.<br />

Examples Example 1. Generate a coarse sine curve and interpolate over a finer abscissa.<br />

x = 0:10;<br />

x<br />

xi<br />

Y yi

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

Saved successfully!

Ooh no, something went wrong!