<< scidoe_compare Support scidoe_plotcube >>

Scidoe >> Support > scidoe_pdist

scidoe_pdist

Pairwise point distances of a matrix

Parameters

X :

a m-by-n matrix of doubles, the input vector

H :

a 1-by-b matrix of doubles, the distance vector, where b = m*(m-1)/2 the binomial coefficient

Description

This function computes all the pairwise point distances of a matrix. The number of combinations of the points in each variable (column) is equal to the binomial coefficient m*(m-1)/2.

The resulted matrix contains all pairwise point distances, arranged in the order (2,1), (3,1), ..., (m,1), (3,2), ..., (m,2), ..., (m,m–1) If input matrix X includes only one sample point, then an empty matrix is returned.

The function implements only the Euclidean distance case.

Examples

// Compute the euclidean distance between all pairs of points of the matrix
X = [0.1629447    0.8616334
0.5811584    0.3826752
0.2270954    0.4442068
0.7670017    0.7264718
0.8253974    0.1937736]

H = scidoe_pdist(X)

Bibliography

http://www.mathworks.com/help/toolbox/stats/pdist.html

http://forge.scilab.org/index.php/p/specfun/source/tree/HEAD/macros/specfun_subset.sci

Authors


Report an issue
<< scidoe_compare Support scidoe_plotcube >>