![matlab interp1 matlab interp1](https://www.mathworks.com/help/examples/matlab/win64/InterpolateMultipleSetsofDatainOnePassExample_01.png)
Pp = interp1(x,Y,method,'pp') uses the specified method to generate the piecewise polynomial form (ppform) of Y. Returns the scalar extrapval for out of range values. Uses the specified method to perform extrapolation for out of range values. For all other methods, interp1 performs extrapolation for out of range values. Īssumes that x = 1:N, where N is the length of Y for vector Y, or size(Y,1) for matrix Y.įor the 'nearest', 'linear', and 'v5cubic' methods, interp1(x,Y,xi,method) returns NaN for any element of xi that is outside the interval spanned by x.
![matlab interp1 matlab interp1](https://walkingrandomly.com/images/matlab/interp1_data.png)
If Y is an array that is not a vector, the size of Y must have the form, where n is the length of x.xi can be a scalar, a vector, or a multidimensional array, and yi has the same size as xi. A scalar value for x or Y is expanded to have the same length as the other.
![matlab interp1 matlab interp1](https://embernek-loro.com/zeovbr/x2RWAPLt69gJ1jyAzP3UJAAAAA.jpg)
If Y is a scalar or vector, it must have the same length as x.Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: Yi = interp1(x,Y,xi) interpolates to find yi, the values of the underlying function Y at the points in the vector or array xi. One-dimensional data interpolation (table lookup) Interp1 (MATLAB Functions) MATLAB Function Reference