clear
x=-5:5;
y=x.*x;
xi=-5:0.5:5;
y0=xi.*xi;
y1=spline(x,y,xi);
y2=interp1(x,y,xi,'spline');            
plot(x,y,'O',xi,y0,xi,y1,'+',xi,y2,'*')
legend('原始数据','插值点真实数据','spline插值','interp1样条插值')
max(abs(y1-y2))




