|
|
| File Information |
| Description |
Returns the point-to-point distance between all pairs of points (similar to PDIST in the Statistics Toolbox, for those without it)
DMAT = DISTMAT(XY) Calculates the distance matrix using an automatic option
DMAT = DISTMAT(XY,OPT) Uses the specified option to compute the distance matrix
[DMAT,OPT] = DISTMAT(XY) Also returns the automatic option used by the function
Inputs:
XY is an NxP matrix of coordinates for N points in P dimensions
OPT (optional) is an integer between 1 and 4 representing the chosen method for computing the distance matrix (see note below)
Outputs:
DMAT is an NxN matrix, where the value of DMAT(i,j) corresponds to the distance from XY(i,:) to XY(j,:)
OPT (optional) is an integer between 1 and 4 representing the method used to compute the distance matrix (see note below)
Note:
DISTMAT contains 4 methods for computing the distance matrix
OPT=1 Usually fastest for small inputs. Takes advantage of the symmetric property of distance matrices to perform half as many calculations
OPT=2 Usually fastest for medium inputs. Uses a fully vectorized method
OPT=3 Usually fastest for large inputs. Uses a partially vectorized method with relatively small memory requirement
OPT=4 Another compact calculation, but usually slower than the others |
| Acknowledgements |
This submission has inspired the following:
IPDM: Inter-Point Distance Matrix
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (3) |
| 05 Jun 2007 |
Siyi Deng
|
|
|
| 06 Jun 2007 |
Jon Dattorro
|
|
|
| 29 Jun 2007 |
Nina Hendrarini
|
|
|
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com