www.pudn.com > 实验7-线形拟合.rar > examp076.m
format short
x0=[1,0,40];
%缺省: 大规模算法;
[x,resnorm,res]=lsqnonlin('fun076',x0)
pause
opt1=optimset('LargeScale', 'off');
%缺省: Levenberg-Marquardt算法;
[x,resnorm,res]=lsqnonlin('fun076',x0,[],[],opt1)
pause
% Gauss-Newton算法;
opt2=optimset(opt1,'LevenbergMarquardt','off');
[x,resnorm,res]=lsqnonlin('fun076',x0,[],[],opt2)
pause
t1=0:0.1:12;
y1=fun076(x,t1);
hold on
plot(t1,y1)
xlabel('时间轴')
ylabel('血药浓度')
hold off