examp076.m

来自「1、掌握MATLAB优化工具箱的基本用法」· M 代码 · 共 23 行

M
23
字号
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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?