⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 func14.m

📁 数值分析最常用的四十种算法
💻 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 + -