histsave.m

来自「粒子群算法」· M 代码 · 共 23 行

M
23
字号
clear;
clc;
histPlot=zeros(1,2001);
iCount=0;
resultGood = 100000;
for i=1:3
Result = PSO();
legth = length(Result)

if (resultGood >  Result(legth))
    resultGood =Result(legth);
end
%if (Result(legth)<5)
iCount= iCount+1;
histPlot = histPlot+Result;

%end
end
histPlot = histPlot./iCount;
legth = length(histPlot)
plot(1:legth,histPlot(1:legth));
axis([0 legth-1 0 600]);
resultGood

⌨️ 快捷键说明

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