📄 bandemoutfcn.m
字号:
function stop = bandemOutFcn(x,optimvalues,state,userdata,varargin)
%
% Output function that plots the iterates
stop = false;
if strcmp(state,'iter')
xpbanplt(x);
end
%xpbanplt函数的程序代码
function out = xpbanplt(currPos,prevPos)
%XPBANPLT Plots one step of solution path.
if nargin==1,
x1=currPos(1);
y1=currPos(2);
z1=100*(y1-x1.^2).^2+(1-x1).^2;
plot3(x1,y1,z1,'g.', ...
'EraseMode','none', ...
'MarkerSize',25);
drawnow; % Draws current graph now
out = [];
elseif nargin==2,
x1=prevPos(1);
x2=currPos(1);
y1=prevPos(2);
y2=currPos(2);
z1=100*(y1-x1.^2).^2+(1-x1).^2;
z2=100*(y2-x2.^2).^2+(1-x2).^2;
plot3([x1 x2],[y1 y2],[z1 z2],'b-', ...
'EraseMode','none', ...
'LineWidth',2);
plot3([x1 x2],[y1 y2],[z1 z2],'g.', ...
'EraseMode','none', ...
'MarkerSize',25);
drawnow; % Draws current graph now
out = [];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -