曲线拟合与自定义方程

时间:2018-03-15 07:24:05

标签: matlab curve-fitting

我试图用MATLAB的自定义方程拟合实验数据。我感兴趣的参数是y0tauDC。但我一直收到一个错误,说矩阵尺寸必须与以下代码一致:

t = [0.00468
0.01277
0.05987
0.10316
0.18595
0.29252
0.39529
0.52136
0.68313
0.88818
1.08182
1.28688
1.45625
1.57471
1.73267
1.84685]
y = [9.02766
7.53879
5.3679
4.28093
3.09349
2.11005
1.63202
1.10224
0.77341
0.54506
0.42022
0.24363
0.21623
0.11575
0.11575
0.06704]

a1 = 10.86;
a2 = 15.5;
b1 = 8.74;
E = 1e15;


F = @(x,xdata)y0.*exp(-xdata./tau-(4.*pi./3).*E.*(1.7725).*(C.*xdata).^(1/2).*((1.+a1.*(D.*C.^(-1/3).*xdata.^(2/3)...
    )+a2.*(D.*C.^(-1/3).*xdata.^(2/3)).^2)./(1.+b1.*(D.*C.^(-1/3).*xdata.^(2/3))).^(3/4)));

X0 = [1 1e-3 1e-13 1e-30];
[x,resnorm,~,exitflag,output] = lsqcurvefit(F,X0,t,y)

在插入的图中描述了等式,并且在另一个图中示出了使用函数g来拟合数据的示例。谢谢你的帮助。

enter image description here

enter image description here

0 个答案:

没有答案