MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Computing euclidean distances between every row of... 

Subject: Computing euclidean distances between every row of a position matrix From: Kelsey Date: 31 May, 2011 21:13:02 Message: 1 of 8 
I'm new to MATLAB and have been learning how to program with it through Internet research and trial/error. I have a matrix that contains position data (columns are x, y, and z, and rows are each node on the graph.) I would like to create an N*N matrix (where N is the number of nodes on the graph) where each entry is the euclidean distance between the nodes specified by the indices of that entry. I know that I want to use a biograph object so that I can use the allshortestpaths function to get the distance matrix I want, but I need help creating the biograph object and connection matrix and somehow loading it with all of my position data so that I can use the allshortestpaths function. 
Subject: Computing euclidean distances between every row of a position matrix From: Matt J Date: 31 May, 2011 21:21:04 Message: 2 of 8 
No idea what a biograph object is, but here's what I use: 
Subject: Computing euclidean distances between every row of a position matrix From: Roger Stafford Date: 31 May, 2011 22:51:04 Message: 3 of 8 
"Kelsey" wrote in message <is3lku$ku1$1@newscl01ah.mathworks.com>... 
Subject: Computing euclidean distances between every row of a position matrix From: Matt J Date: 1 Jun, 2011 13:54:05 Message: 4 of 8 
"Roger Stafford" wrote in message <is3rco$5vj$1@newscl01ah.mathworks.com>... 
Subject: Computing euclidean distances between every row of a position matrix From: Kelsey Date: 1 Jun, 2011 18:41:02 Message: 5 of 8 
"Matt J" wrote in message <is5g9t$gs9$1@newscl01ah.mathworks.com>... 
Subject: Computing euclidean distances between every row of a position matrix From: Image Analyst Date: 1 Jun, 2011 20:07:04 Message: 6 of 8 
How about 
Subject: Computing euclidean distances between every row of a position matrix From: Kelsey Date: 1 Jun, 2011 20:21:04 Message: 7 of 8 
"Image Analyst" wrote in message <is6658$pbh$1@newscl01ah.mathworks.com>... 
Subject: Computing euclidean distances between every row of a position matrix From: Roger Stafford Date: 1 Jun, 2011 20:58:07 Message: 8 of 8 
"Matt J" wrote in message <is5g9t$gs9$1@newscl01ah.mathworks.com>... 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.