⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bandemoutfcn.m

📁 matlab源代码,适用于开发研究,带来很好的学习效果.
💻 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 + -