how to create matrix with coordinates and calculate distance?
Show older comments
n = 3; ri=0.9
source = 1;
destination = 3;
Link=(n*(n-1))/2;
c=2^Link;
NN = toeplitz(Link+1:-1:2)
mask = logical(fliplr(diag(ones(1,Link-1),-1)));
NN(mask) = 1;
for c = 0:2^Link-1
l = bitget(c, NN)
end
i have this type matrix code. l is the matrix.how to calculate distance.
i = 1 :n
j = i+1:n
D(i,j) = sqrt((x(i)-x(j))^2 + (y(i)-y(j))^2);
please help to calculate distance.
Accepted Answer
More Answers (1)
ankanna
on 9 Jul 2021
0 votes
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!