function matdist = geradis(n)

matdist = 0.5*eye(n);

for i = 1:n-1
   matdist(i,i+1:n) = rand(1,n-i);
end

matdist = matdist + matdist';