| 查看: 607 | 回复: 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语言实现? |
» 猜你喜欢
A期刊撤稿
已经有3人回复
职称评审没过,求安慰
已经有34人回复
垃圾破二本职称评审标准
已经有17人回复
回收溶剂求助
已经有6人回复
投稿Elsevier的Neoplasia杂志,到最后选publishing options时页面空白,不能完成投稿
已经有22人回复
申请26博士
已经有5人回复
EST投稿状态问题
已经有7人回复
毕业后当辅导员了,天天各种学生超烦
已经有4人回复
求助文献
已经有3人回复
投稿返修后收到这样的回复,还有希望吗
已经有8人回复














回复此楼