outputdata.m

来自「粒子群算法的MATLAB源码」· M 代码 · 共 18 行

M
18
字号
%实时输出结果

%输出当前种群中粒子位置
subplot(1,2,1);
for i=1:popsize
    plot(pop(i,1),pop(i,2),'b*');
    hold on;
end

plot(gbest_x,gbest_y,'r.','markersize',20);axis([-2,2,-2,2]);
hold off;

subplot(1,2,2);
axis([0,gen,-0.00005,0.00005]);

if exetime-1>0
    line([exetime-1,exetime],[best_in_history(exetime-1),best_fitness]);hold on;
end

⌨️ 快捷键说明

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