文件名称:GA matlab算法程序
文件大小:2KB
文件格式:M
更新时间:2014-10-26 03:28:07
GA matlab
matlab GA算法程序 clc,clear load sj.txt sj = [sj;sj(1,:)]; x = sj(:,2); y=sj(:,3); sj = [x y]; %距离矩阵 d N = size(sj,1); d = zeros(N); for i=1:(N-1) for j=i+1:N d(i,j) = sqrt((x(i)-x(j))^2 + (y(i)-y(j))^2) + 0.5; end end