我在MATLAB中输入了实验数据和一条拟合曲线,如何对比拟合曲线相对于真实数据的精确度?程序如clear;clc;%%%实验数据点x=[12,26,38,120,382,436,1266,11870,76120];y=[0.04419,0.03343,0.02762,0.01936,0.01484,0.01031,0.00
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 15:54:41
我在MATLAB中输入了实验数据和一条拟合曲线,如何对比拟合曲线相对于真实数据的精确度?程序如clear;clc;%%%实验数据点x=[12,26,38,120,382,436,1266,11870,76120];y=[0.04419,0.03343,0.02762,0.01936,0.01484,0.01031,0.00
我在MATLAB中输入了实验数据和一条拟合曲线,如何对比拟合曲线相对于真实数据的精确度?程序如
clear;
clc;
%%%实验数据点
x=[12,26,38,120,382,436,1266,11870,76120];
y=[0.04419,0.03343,0.02762,0.01936,0.01484,0.01031,0.00822,0.00626,0.00459];
hold on;
plot(x,y,'ro');
set(gca,'xscale','log','yscale','log');
grid on
for n=1:1:80000;
e(n)=0.18*(2*n)^(-0.6)+0.012*(2*n)^(-0.08567);
n=n+1;
end
n=1:80000;
plot(n,e,'linewidth',2);
set(gca,'xscale','log','yscale','log');
grid on;
我在MATLAB中输入了实验数据和一条拟合曲线,如何对比拟合曲线相对于真实数据的精确度?程序如clear;clc;%%%实验数据点x=[12,26,38,120,382,436,1266,11870,76120];y=[0.04419,0.03343,0.02762,0.01936,0.01484,0.01031,0.00
求个相对误差不就行了吗
ex=0.18*(2*x).^(-0.6)+0.012*(2*x).^(-0.08567);
delta=(y-ex)./ex;
plot(x,delta);