由数据拟合出函数,完全不知道是什么函数?怎么弄x=[0.45,7.72,14.61,24.14,29.7,35.98,44.56,47.45,53.48,54.4,61.16,63.64,64.51,70.47,72.49,72.56,75.07,78.38,80.95,89.72,89.81,90.81,90.94,91.41,96.66,96.68,97.18,100.0]y1=[72.55,65.72,62
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 21:13:09
由数据拟合出函数,完全不知道是什么函数?怎么弄x=[0.45,7.72,14.61,24.14,29.7,35.98,44.56,47.45,53.48,54.4,61.16,63.64,64.51,70.47,72.49,72.56,75.07,78.38,80.95,89.72,89.81,90.81,90.94,91.41,96.66,96.68,97.18,100.0]y1=[72.55,65.72,62
由数据拟合出函数,完全不知道是什么函数?怎么弄
x=[0.45,7.72,14.61,24.14,29.7,35.98,44.56,47.45,53.48,54.4,61.16,63.64,64.51,70.47,72.49,72.56,75.07,78.38,80.95,89.72,89.81,90.81,90.94,91.41,96.66,96.68,97.18,100.0]
y1=[72.55,65.72,62.15,58.02,55.85,52.29,48.08,46.62,42.65,41.63,37.9,36.4,35.37,32.99,31.84,31.44,30.57,29.34,28.11,25.22,25.11,24.57,24.42,24.7,23.02,23.09,22.78,22.03]
y2=[4.28,4.19,4.13,4.06,4.02,3.96,3.87,3.84,3.75,3.73,3.63,3.59,3.57,3.50,3.46,3.45,3.42,3.38,3.34,3.23,3.22,3.20,3.20,3.21,3.14,3.14,3.13,3.09];
拟合出x与y1、y2的函数关系怎么用
拟合出x与y1、y2的函数关系怎么弄(曲线大概是这样的)
由数据拟合出函数,完全不知道是什么函数?怎么弄x=[0.45,7.72,14.61,24.14,29.7,35.98,44.56,47.45,53.48,54.4,61.16,63.64,64.51,70.47,72.49,72.56,75.07,78.38,80.95,89.72,89.81,90.81,90.94,91.41,96.66,96.68,97.18,100.0]y1=[72.55,65.72,62
x=[0.45,7.72,14.61,24.14,29.7,35.98,44.56,47.45,53.48,54.4,61.16,63.64,64.51,70.47,72.49,72.56,75.07,78.38,80.95,89.72,89.81,90.81,90.94,91.41,96.66,96.68,97.18,100.0];
y1=[72.55,65.72,62.15,58.02,55.85,52.29,48.08,46.62,42.65,41.63,37.9,36.4,35.37,32.99,31.84,31.44,30.57,29.34,28.11,25.22,25.11,24.57,24.42,24.7,23.02,23.09,22.78,22.03];
y2=[4.28,4.19,4.13,4.06,4.02,3.96,3.87,3.84,3.75,3.73,3.63,3.59,3.57,3.50,3.46,3.45,3.42,3.38,3.34,3.23,3.22,3.20,3.20,3.21,3.14,3.14,3.13,3.09];
P1=polyfit(x,y1,1);
a=P1(1);b=P1(2);%%%%方程系数
xx1=0:100;
yy1=a*xx1+b;%%%%%%%方程
figure(1)
plot(x,y1,'o',xx1,yy1)
P2=polyfit(x,y2,1);
c=P2(1);d=P2(2);%%%%方程系数
xx2=0:100;
yy2=c*xx2+d;%%%%%%%方程
figure(2)
plot(x,y2,'o',xx2,yy2)
综合考虑合理性与精确性,觉得线性关系为最佳,不知道你到底想得到什么,实际上拟合前都是对拟合函数有一个预估的,不一定说非要越精确越好,那样很容易发生过拟合,过拟合虽然说从表面上精度很高,但可能没有任何意义,可能会失去你所关心的信息.
一般拟合也是在一定的物理或数学背景下进行的,所以要综合考虑合理性与精确性.