calculates for each sample vector the nearest neighbor among a set of cluster centers.
[Neighbors, Distances] = GetNearestNeighbor(Samples, Centers, NormType) [Neighbors] = GetNearestNeighbor(Samples, Centers, NormType)
matrix, contains sample vectors as rows
matrix, contains cluster centers as rows
norm of vectors, must be a scalar greater than zeros, can be %inf
column vector, contains the indices of nearest neighbor for each sample vector
matrix, contains the distances between sample vectors (rows) and cluster centers (columns), optional
This function calculates for each sample vector the nearest neighbor among a set of cluster centers.
Richard O. Duda, Peter E. Hart, David G. Stork, 'Pattern Classification', John Wiley & Sons Inc., New York, Chichester, Weinheim, Brisbane, Singapore, Toronto, Second Edition, 2001