fori=1:popcountpop(i,:)=rand(1,9);%初始化粒子位置V(i,:)=rand(1,9);%初始化粒子速度%计算粒子适应度值Center=pop(i,1:3);SP=pop(i,4:6);W=pop(i,7:9);Distance=dist(Center',SamIn);SPMat=repmat(SP',1,SamNum);%repmat具体作用UnitOut=radbas(Distance./SPMat);NetOut=W*UnitOut;%网络输出Error=SamOut-NetOut;%网络误差%SSE=sumsqr(Error);%fitness(i)=SSE;RMSE=sqrt(sumsqr(Error)/SamNum);fitness(i)=RMSE;%fitness(i)=fun(pop(i,:));end
1