📄 func14.m
字号:
%func14.m
%polynomial Fitting,the residue analysis willbe show at the end
%曲线拟合均调用了matlab的函数
x=linspace(-1,1,9)
y=[-0.2209,0.3295,0.8826,1.4392,2.0003,2.5645,3.1334,3.8061,4.2836];
[p,S] = polyfit(x,y,3)
f = polyval(p,x);
plot(x,y,'o',x,f,'-')
disp(abs(norm(y,inf)-norm(f,inf)))
%p=-0.03562558922559*x^3+0.04342683982684*x^2+2.29792053872054*x+2.00616103896104
%the residure is (defined by infinite norm on those vector) : 0.0283
%can also see the figure
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -