Daniel@0: Daniel@0: Daniel@0: Daniel@0: Netlab Reference Manual dist2 Daniel@0: Daniel@0: Daniel@0: Daniel@0:

dist2 Daniel@0:

Daniel@0:

Daniel@0: Purpose Daniel@0:

Daniel@0: Calculates squared distance between two sets of points. Daniel@0: Daniel@0:

Daniel@0: Synopsis Daniel@0:

Daniel@0:
Daniel@0: d = dist2(x, c)
Daniel@0: 
Daniel@0: Daniel@0: Daniel@0:

Daniel@0: Description Daniel@0:

Daniel@0: d = dist2(x, c) takes two matrices of vectors and calculates the Daniel@0: squared Euclidean distance between them. Both matrices must be of the Daniel@0: same column dimension. If x has m rows and n columns, and Daniel@0: c has l rows and n columns, then the result has Daniel@0: m rows and l columns. The i, jth entry is the Daniel@0: squared distance from the ith row of x to the jth Daniel@0: row of c. Daniel@0: Daniel@0:

Daniel@0: Example Daniel@0:

Daniel@0: The following code is used in rbffwd to calculate the activation of Daniel@0: a thin plate spline function. Daniel@0:
Daniel@0: 
Daniel@0: n2 = dist2(x, c);
Daniel@0: z = log(n2.^(n2.^2));
Daniel@0: 
Daniel@0: Daniel@0: Daniel@0:

Daniel@0: See Also Daniel@0:

Daniel@0: gmmactiv, kmeans, rbffwd
Daniel@0: Pages: Daniel@0: Index Daniel@0:
Daniel@0:

Copyright (c) Ian T Nabney (1996-9) Daniel@0: Daniel@0: Daniel@0: Daniel@0: