Does a cubic spline interpolation of a data set.
Supported Product: FDTD, MODE, DEVICE, INTERCONNECT
out = spline(Ex,xold,xnew);
Cubic spline interpolation of a 1D function.
•Ex is an existing data set
•xold specifies the points where Ex is sampled
•xnew specifies new points to interpolate the data.
The points in xnew do not have to be within the bounds of xold.
Resample Ex at xnew using cubic spline and linear interpolation methods. Note that xnew is outside the bounds of xold.
xnew=linspace(-1,9,25); # defining a new x vector
Exnew=interp(Ex,xold,xnew); # interpolating the new data set
Exnew2=spline(Ex,xold,xnew); # smoothing
legend("old data", "interp", "Spline");
The example code will generate the plot below. The figure shows the difference between the linear and cubic spline interpolation techniques.