func4p1.asv
资源名称:数值分析课程设计.zip [点击查看]
上传用户:zhdd911129
上传日期:2007-05-11
资源大小:722k
文件大小:0k
源码类别:
matlab例程
开发平台:
Matlab
- x=linspace(.5,3.0,6)
- y=[1.75,2.45,3.81,4.80,7.00,8.60]
- p=polyfit(x,y,3)
- xx=linspace(0.5,3,100)
- yy=polyval(p,xx)
- plot(xx,yy,'-')
- f=polyval(p,x)
- disp(abs(norm(y,inf)-norm(f,inf)))
- %the residue is (defined by infinite norm on those vector) : 0.0950
- %如提高为用三次多项式拟合,residue= 0.0517,更为精确;
- %can also see the figure