谁会用matlab曲线拟合呀,能不能qq教我怎么弄,教会我我所有的财富值都给你哦(173财富值)

2025-06-26 21:43:57
推荐回答(2个)
回答1:

A = [1 0.0000259
2 0.0000847
4 0.0001071
6 0.007056
7 0.001915
8 0.004115
10 0.01217
12 0.02386
15 0.04481
20 0.09164
25 0.1571
30 0.2403
35 0.3374
40 0.4431
45 0.5521
50 0.6600
60 0.8606
70 1.0315
80 1.1704
90 1.2807
100 1.3671];

x=A(:,1);
y=A(:,2);

opts = fitoptions('Method','Nonlinear','Normalize','On');
opts.StartPoint = [1.3 100 36 0.5 65 25 0.2 40 18];
ftype = fittype('a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2) + a3*exp(-((x-b3)/c3)^2)','options',opts);
[fresult,gof] = fit(x,y,ftype)

x1=[0:0.1:100];
plot( x1, fresult(x1), x, y, '* ') % 拟合图 原始数据
title('拟合图 原始数据')

回答2:

plot会用的吧
然后在显示的figure选择”tool“----->"basic fitting"
然后想怎么拟合就怎么拟合,2次,3次。。。。。。。。。。。。。