How to find the distance between vectors given in a cell array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
That Guy
am 12 Nov. 2020
Kommentiert: Ameer Hamza
am 12 Nov. 2020
say i have a cell array in the form p = {[x1, y1], [x2, y2],...,[xn, yn]}
i want to find the number of points that arent within r distance of eachother. I know that pdist will find the distance between points but im not sure how to break this cell array up in order to apply this function. Any help?
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 12 Nov. 2020
You can apply pdist() like this
p = {[x1, y1], [x2, y2], [x3, y3]};
P = vertcat(P{:});
D = pdist(P);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!