电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

完整版matlab插值法实例VIP免费

完整版matlab插值法实例_第1页
完整版matlab插值法实例_第2页
完整版matlab插值法实例_第3页
Several Typical Interpolation in Matlab Lagrange Interpolation Supposing:x 144 169 225 y 12 13 15 If x=175, while y=? Solution :Lagrange Interpolation in Matlab: function y=lagrange(x0,y0,x); n=length(x0);m=length(x); for i=1:m z=x(i); s=0.0; for k=1:n p=1.0; for j=1:n if j~=k p=p*(z-x0(j))/(x0(k)-x0(j)); end end s=p*y0(k)+s; end y(i)=s; end input :x0=[144 169 225] y0=[12 13 15] y=lagrange(x0,y0,175) obtain the answer:x0 = 144 169 225 y0 = 12 13 15 y = 13.2302 Spline Interpolation Supposing: x 1 4 9 16 x1 2 3 4 Resolve the cubic spline function s(x)Solution :Input x=[ 1 4 9 6] ;y=[ 1 4 9 6] ;x=[ 1 4 9 6] ;pp=spline(x,y) pp = form: 'pp' breaks: [1 4 6 9] coefs: [3x4 double] pieces: 3 order: 4 dim: 1 output : pp.coefsans = -0.0500 0.5333 -0.8167 1.0000 -0.0500 0.0833 1.0333 2.0000 -0.0500 -0.2167 0.7667 4.0000 It shows the coefficients of cubic spline polynomial , so: S(x)=,169,3)9(1484.0)9(0063.0)9(0008.0,94,2)4(2714.0)4(0183.0)4(0008.0,41,1)1(4024.0)1(0254.0)1(0008.0232323xxxxxxxxxxxxNewton’ s InterpolationSupposing: x 1 4 9 x1 2 3 Resolve 65Solution:Newton ’ s Interpolation in matlab:function yi=newint(x,y,xi); n=length(x); ny=length(y); if n~=ny error end Y=zeros(n);Y(:,1)=y'; for k=1:n-1 for i=1:n-k if abs(x(i+k)-x(i))

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

文库当当响+ 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

确认删除?
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群