qa77533
幼苗
共回答了21个问题采纳率:95.2% 举报
主程序:
year=1790:10:2000;
popu=[3.9 5.3 7.2 9.6 12.9 17.1 23.2 31.4 38.6 50.2 62.9 76 92 106.5 123.2 131.7 150.7 179.3 204.0 226.5 251.4 281.4];
opt=statset('MaxIter',1000);
beta1 = nlinfit(year,popu,@mymodel1,0.1, opt)
beta2 = nlinfit(year,popu,@mymodel2,[1 0.1], opt)
mymodel1.m:
function y=mymodel1(beta1,x)
y=3.9*exp(beta1*(x-1790));
mymodel2.m:
function y=mymodel2(beta2,x)
y=beta2(1)*exp(beta2(2)*(x-1790));
结果
beta1 =
0.0212
beta2 =
14.9939 0.0142
1年前
5