Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Euclidean distance of all pairwise combinations (redundants)
Replies: 7   Last Post: Feb 1, 2013 1:16 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bob Hanlon

Posts: 906
Registered: 10/29/11
Re: Euclidean distance of all pairwise combinations (redundants)
Posted: Feb 1, 2013 1:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

It isn't clear what form you want the output to take

list1 = Array[a, {3, 3}];

list2 = Array[b, {2, 3}];

list3 = Outer[Norm[#1 - #2] &, list1, list2, 1]


list3 // Flatten

Bob Hanlon

On Thu, Jan 31, 2013 at 8:47 PM, <vasiliadesmixalis@gmail.com> wrote:
> Hi,
> I am wondering on how to get the euclidean distance between all the point from two different list .
> For example : list1=[{1,1,1},{1,3,1},{3,2,4}] , list2=[{1,2,1},{1,2,3}] etc.
> how to find the euclidean comparing all the pairs ?? {1,1,1} with {1,2,1} and then {1,1,1} with {1,2,3} etc...

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2016. All Rights Reserved.