for i = 1:1:point for j = 1:1:point if( allcoefdist(i,j) == 0) allcoefdist(i,j)=inf; end endend结果很多原值为0的没有被修改为无穷大