运用matlab进行曲线拟合,求出参数H = a(0 )+ a(1)* G + a(2)*G^2 + a(3) *G^3,已经知道五组数据,怎么拟合出来这个曲线,[H,G]=[17.4,15993.288],[21.98,13851],[26.0295,11637.46656],[28.86149,9794.567412],[30.737328,8352.9348],
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 01:27:07
运用matlab进行曲线拟合,求出参数H = a(0 )+ a(1)* G + a(2)*G^2 + a(3) *G^3,已经知道五组数据,怎么拟合出来这个曲线,[H,G]=[17.4,15993.288],[21.98,13851],[26.0295,11637.46656],[28.86149,9794.567412],[30.737328,8352.9348],
运用matlab进行曲线拟合,求出参数
H = a(0 )+ a(1)* G + a(2)*G^2 + a(3) *G^3,已经知道五组数据,怎么拟合出来这个曲线,[H,G]=[17.4,15993.288],[21.98,13851],[26.0295,11637.46656],[28.86149,9794.567412],[30.737328,8352.9348],
运用matlab进行曲线拟合,求出参数H = a(0 )+ a(1)* G + a(2)*G^2 + a(3) *G^3,已经知道五组数据,怎么拟合出来这个曲线,[H,G]=[17.4,15993.288],[21.98,13851],[26.0295,11637.46656],[28.86149,9794.567412],[30.737328,8352.9348],
m程序为:
g=[15993.288 13851 11637.46656 9794.567412 8352.9348];
h=[17.4 21.98 26.0295 28.86149 30.737328];
p=polyfit(g,h,3);
p
g2=5000:1000:20000;
h2=polyval(p,g2);
plot(g,h,'o',g2,h2);
xlabel('g');
ylabel('h')
title('H = a(0 )+ a(1)* G + a(2)*G^2 + a(3) *G^3拟合曲线')
运行上面m文件得到结果如下:
p =
0.0000 -0.0000 0.0000 35.5845
也就是H= 35.5845*G^3