| 查看: 640 | 回复: 0 | ||
| 【悬赏金币】回答本帖问题,作者月璎珞将赠送您 300 个金币 | ||
月璎珞至尊木虫 (职业作家)
|
[求助]
求带参数约束条件的数据拟合C语言代码
|
|
|
已知两列数据:X=[x1, x2, ……, xn],Y=[y1, y2, ……, yn]; 拟合函数y=a*x^b+c拟合,其中a, b, c是拟合参数,且参数b必须满足约束条件:b∈[m, n]. 我能用matlab实现,但现在需要不安装matlab,用C语言运行,跪求大神帮忙! ![]() ![]() 附matlab算例: x=[332 414 507 653 739 888 1060 1268 1607 1920 2438 2886 3485]; y=[4.7 5.1 5.5 6 6.3 6.7 7.1 7.5 8 8.4 8.8 9.1 9.4]-4.7; x=x'; % transfer Row matrix to Column matrix; y=y'; p1=fittype('a*x^b+c','dependent',{'y'},'independent',{'x'},'coefficients',{'a', 'b', 'c'}); % Fitting function opts = fitoptions( 'Method', 'NonLinearLeastSquares' ); opts.Lower = [0 0.3 -20]; opts.StartPoint = [1, 0.4,-0.25]; opts.Upper = [200 0.49 0]; f1=fit(x,y,p1,opts); res1=[coeffvalues(f1)] 不用安装matlab软件,怎么把上面的程序用C语言实现? |
» 猜你喜欢
材料求调剂
已经有11人回复
【求调剂】新能源材料本科,一志愿211,初试321
已经有4人回复
336求调剂
已经有5人回复
材料求调剂
已经有8人回复
材料工程322分
已经有7人回复
材料考研调剂
已经有5人回复
生物学308分求调剂(一志愿华东师大)
已经有4人回复
求生物学调剂
已经有8人回复
08生物与医药专硕初试346找调剂
已经有6人回复
生物学327,求调剂
已经有6人回复















回复此楼