I am attempting to write a code to find a minimum number from the 'distance' matrix, excluding zeroes from the matrix.
distance=[0 0.44 0.40 0.63 0.89
0.44 0 0.44 0.72 1.00
0.40 0.44 0 0.28 0.56
0.63 0.72 0.28 0 0.28
0.89 1.00 0.56 0.28 0]
for i=1:Nodes
for j=1:Nodes
if (distance(i,j)~=0)
[mini(i,:)]=[min(distance(i,:))];
end
end
end
Any help is appreciated! Thank you!
dinstead ofdistance.