各位高手,谁知道怎么把这两个相互对应的数组的曲线给我拟合出来。
用C/C++都可以!很急知道帮忙一下~~~小弟感激不尽。
double X[21] = {0.00,0.056,0.112,0.168,0.224,0.280,0.336,0.392,0.448,0.504,0.560, 0.616,0.672,0.728,0.784,0.84,0.896,0.952,0.1008,0.1064,1.12}
double Y[21] = {0.00,1.66,3.31,4.96,6.6,8.22,9.82,11.4,12.94,14.43,15.86,17.22,18.5, 19.69,20.79,21.79,22.71,23.53,24.25,24.87,25.4};谢谢拉~~
參考答案:应该是拟合直线,可用最小二乘法。最小二乘法的程序网上一搜一大堆,C++的也有。