我想实现的是将大量数据样本点通过最小二乘法进行曲面拟合,最小二乘法和插值法不同的是,拟合无需过每一个点。保证R值最好就可以了
但是满足最小二乘法的多项式形式有很多,按照不同的数据,可以采用多种不同的多项式,很多时候需要自己定义多项式
因此我想按照自己定义的多项式,通过
labview拟合后,由labview导出系数,
举例说明:
我自定义的式子:
Y=F1+F2
F1=a+b*x1+c*x1^2+d*x1^3+e*x1^4+f*x1^5+g*x1^6
F2=m*x2+n*x2^2+o*x2^3
我的数据样本如下如下:
X1X2Y0.141520.3540.149220.3580.15720.35120.165490.35160.17410.35200.183060.35240.192360.35280.202040.35320.212080.35360.222520.35400.141180.640.148820.680.156760.6120.165010.6160.173580.6200.182480.6240.191740.6280.201370.6320.211360.6360.221750.6400.140760.8540.148370.8580.156260.85120.164460.85160.172980.85200.181850.85240.191050.85280.200630.85320.210590.85360.220950.85400.140261.140.147831.180.155681.1120.163851.1160.172331.1200.181851.1240.190321.1280.199861.1320.209781.1360.220081.1400.13971.3540.147231.3580.155051.35120.163181.35160.171631.35200.18041.35240.189541.35280.199041.35320.208931.35360.219211.35400.139071.640.146571.680.154351.6120.162441.6160.170861.6200.179611.6240.188721.6280.198181.6320.208031.6360.218271.6400.138381.8540.145841.8580.15361.85120.161661.85160.170041.85200.178771.85240.187851.85280.197281.85320.207111.85360.217321.85400.137622.140.145062.180.152792.1120.160832.1160.169182.1200.177882.1240.186932.1280.196342.1320.206142.1360.216342.140
通过
matlab好像只能计算拟合出最高阶5阶的多项式,同时对matlab也不熟悉,因此想采用labview通过以上数据,按照自己定义的多项式进行拟合,拟合出如下曲面,
并且计算输出多项式中的系数
a,b,c,d,e,f,g,h, m,n,o
一周热门 更多>