Post Reply 
Euclidian distance matrix
04-16-2016, 01:31 PM
Post: #2
RE: Euclidian distance matrix
On the Prime, for the euclidean distance matrix :

Let say that you use M1 and M2 to store your sets of points
Code:
M1:=[[1.1,3.1],[2.1,4.1],[3.4,3.2]]
M2:=[[0.7,2.1],[1.6,3.6],[3.2,1.6],[3.5,2.1],[3.1,4]]

Then you can get the distance matrix with:
Code:
MAKEMAT(√((M1(I,1)-M2(J,1))^2+(M1(I,2)-M2(J,2))^2),rowDim(M1),rowDim(M2))

With the fixed 2 number format setting the result is :
   

You can easily create a program for this function.

For the cumulative distance matrix do you have a reference explaining how it is calculated ?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Euclidian distance matrix - in06khattab - 04-16-2016, 10:20 AM
RE: Euclidian distance matrix - Didier Lachieze - 04-16-2016 01:31 PM
RE: Euclidian distance matrix - DrD - 04-17-2016, 11:07 AM



User(s) browsing this thread: 1 Guest(s)