calculate the distance between two successive dots
Mostra commenti meno recenti
Hello friends..
- my table contains 79 points
*here is my code
=======================
- T = zeros;
*x=0;z=0;
- a=length(points);%79points
*for i = 1:a
*for j = i+1:a
- x = x + 1;
- d1 = norm(points(j)-points(i));
- T(x,:) = d1;
end
end
end
xlswrite('d:\result.xlsx',T);
========================================
*I want to calculate the distance between two successive dots ie: (point1,point2),(point3,point4),point5,point6)
*I normally get 39 distance but I got 3081 distance(because the loop it calculated the distance between all points)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!