MATLAB求解logistic阻滞模型的三个参数求教大神帮看,我用的MATLAB版本R2012a希望求出函数中三个参数,但是老是运行不出来>> xdata=[1,2,3,4,5,6,7,8,9,10,11,12,13,14];>> ydata=[124761 125786 126743 127627 128453 129227
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 12:38:29
MATLAB求解logistic阻滞模型的三个参数求教大神帮看,我用的MATLAB版本R2012a希望求出函数中三个参数,但是老是运行不出来>> xdata=[1,2,3,4,5,6,7,8,9,10,11,12,13,14];>> ydata=[124761 125786 126743 127627 128453 129227
MATLAB求解logistic阻滞模型的三个参数
求教大神帮看,我用的MATLAB版本R2012a
希望求出函数中三个参数,但是老是运行不出来
>> xdata=[1,2,3,4,5,6,7,8,9,10,11,12,13,14];
>> ydata=[124761 125786 126743 127627 128453 129227 129988 130756 131448 132129 132802 133474 134091 134735];
>> f=inline('p(1)./(1+(p(1)/p(2)-1)*exp(-p(3)*xdata))','p','xdata');
>> p=lsqcurvefit(f,[167570,123740,0.005],xdata,ydata);
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to its initial value is less than the default value of the function tolerance.
MATLAB求解logistic阻滞模型的三个参数求教大神帮看,我用的MATLAB版本R2012a希望求出函数中三个参数,但是老是运行不出来>> xdata=[1,2,3,4,5,6,7,8,9,10,11,12,13,14];>> ydata=[124761 125786 126743 127627 128453 129227
把
f=inline('p(1)./(1+(p(1)/p(2)-1)*exp(-p(3)*xdata))','p','xdata');
改成这样
f=inline('p(1)./(1+(p(1)./p(2)-1).*exp(-p(3).*xdata))','p','xdata');
就ok了.
>> xdata=[1,2,3,4,5,6,7,8,9,10,11,12,13,14];
>> ydata=[124761 125786 126743 127627 128453 129227 129988 130756 131448 132129 132802 133474 134091 134735];
>> f=inline('p(1)./(1+(p(1)./p(2)-1).*exp(-p(3).*xdata))','p','xdata');
>> p=lsqcurvefit(f,[167570,123740,0.005],xdata,ydata);
>> vpa(p)
ans =
[ 146892.17624742476618848741054535,123858.20345970198104623705148697,0.051286170709734291150994067720603]