函数插值与曲线拟合方法及实例分析.pdfVIP

  • 0
  • 0
  • 约小于1千字
  • 约 1页
  • 2026-05-12 发布于北京
  • 举报

函数插值与曲线拟合方法及实例分析.pdf

函数插值与曲线拟合

1、函数插值

一维插值:interp1(x,y,cx,’method’)

一维插值:interp1(x,y,z,cx,cy,’method’)

method:nearest、linear、spline、cubic

例:

clear

echoon

x-2:0.4:2;

y=[2.82.962.543.443.565.4

6.08.710.113.314.0];

t-2:0.01:2;

nst=interp1(x,y,t,nearest);

plot(x,y,r*,t,nst)

title(最点插值)

lnr=interp1(x,y,t,linear);

figure(2)

plot(x,y,r*,t,lnr,b:)

title(线性插值)

spl=interp1(x,y,t,spline);

figure(3)

plot(x,y,r*,t,spl)

title(样条插值)

cbc=interp1(x,y,t,cubic);

figure(4)

plot(x,y,r*,t,cbc,k-)

t

文档评论(0)

1亿VIP精品文档

相关文档