| 查看: 467 | 回复: 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语言实现? ![]() |
» 猜你喜欢
JMPT 期刊投稿流程
已经有4人回复
博士读完未来一定会好吗
已经有18人回复
心脉受损
已经有5人回复
Springer期刊投稿求助
已经有4人回复
读博
已经有3人回复
小论文投稿
已经有3人回复
Bioresource Technology期刊,第一次返修的时候被退回好几次了
已经有9人回复
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有8人回复
申请2026年博士
已经有6人回复














回复此楼