matlab实现三次样条插值

%x,y为原始离散数据横坐标,纵坐标
%xi为插值间隔,本程序设置为0.1
%调用spline函数即可得到插值结果,再绘图即可
x = 0:2:22;
y = 2*exp(x).*sin(x);
xi = 0:0.1:22;
yi = spline(x,y,xi);
plot(x,y,'*',xi,yi);

参考资料:https://jingyan.baidu.com/article/fb48e8beda889e6e622e14e6.html

猜你喜欢

转载自blog.csdn.net/gls_nuaa/article/details/113127603
今日推荐