matlab题:对于函数f(x)=1/(1+25x^2),在区间[-1,1]上取Xi=-1+0.2*i(i=0,1,…,10),试求三次曲线拟试求三次曲线拟合?回答者,

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 22:34:29
matlab题:对于函数f(x)=1/(1+25x^2),在区间[-1,1]上取Xi=-1+0.2*i(i=0,1,…,10),试求三次曲线拟试求三次曲线拟合?回答者,matlab题:对于函数f(x)

matlab题:对于函数f(x)=1/(1+25x^2),在区间[-1,1]上取Xi=-1+0.2*i(i=0,1,…,10),试求三次曲线拟试求三次曲线拟合?回答者,
matlab题:对于函数f(x)=1/(1+25x^2),在区间[-1,1]上取Xi=-1+0.2*i(i=0,1,…,10),试求三次曲线拟
试求三次曲线拟合?回答者,

matlab题:对于函数f(x)=1/(1+25x^2),在区间[-1,1]上取Xi=-1+0.2*i(i=0,1,…,10),试求三次曲线拟试求三次曲线拟合?回答者,
i = 0:10;
x = -1+0.2*i;
y = 1./(1+25*x.^2);
p=polyfit(x,y,3);
s=vpa(poly2sym(p))
f = polyval(p,x);
plot( x,f,x,y,'o ')
三次曲线拟合结果:
s = -.18688658920776270929651442156525e-15*x^3-.57518273581621997911590671771667*x^2+.10642860455919865470368948113046e-15*x+.48412492484890679023123993829358