interp1
One dimensional interpolation.
(yn,interploator)=interp1(x,y,xn,option)
(yn,interploator)=interp1(x,y,xn)
yn=interp1(interpolator,xn);
Inputs
x A real vector sepcifying the points at which the function values are known.
y A real vector, containing the values of the function to be interpolated at the points defined by x .
xn A real array, containing the values of x at which the interpolated values of the function are needed.
interpolator The second output of a prior call to interp1 .
option 'nn' for nearest neigbor interpolation, 'linear' for linear interpolation, 'cubic' for piecewise cubic interpolation, and 'spline' for spline interpolation. The default value of option is 'cubic' .
Outputs
yn The interpolated values of the function at the points specified by xn .
interpolator An object that can be used subsequently to interpolate the same function at other points by using the last form of call to interp1 .


Example
>>x=[0:.1:1]*pi;
>>y=sin(x)
>>z=interp1(x,y,xn=[0:.02:1]*pi)
>>plot(x,y,xn,z)