func4p2.asv
资源名称:数值分析课程设计.zip [点击查看]
上传用户:zhdd911129
上传日期:2007-05-11
资源大小:722k
文件大小:0k
源码类别:
matlab例程
开发平台:
Matlab
- x=linspace(1,12,12)
- y=[12,234,34,-1,34,2,5,23,34,9,45,23]
- p=polyfit(x,y,6)
- xx=linspace(1,12,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):135.5165,相当高。
- %如提高为用六次多项式拟合,residue= 40.7265,比较精确;次:residue=0.3729;四次:residue=0.0238
- %can also see the figure