Pdist2 matlab. example. Pdist2 matlab

 
 examplePdist2 matlab Dear Gentlemen i face problem when i use pdist2 function of hamming distance between two binary images in same size, the output result is an array not a percentage value, where i want to use hamming distance to calculate the percentage difference between two binary images:There is a file at c:	oolboxclassifypdist2

0000 0. More Answers (0) Sign in to answer this question. 判别分析时,通常涉及到计算两个样本之间的距离,多元统计学理论中有多种距离计算公式。MATLAB中已有对应函数,可方便直接调用计算。距离函数有:pdist, pdist2, mahal, squareform, mdscale, cmdscale. This MATLAB function performs k-means clustering to partition the observations of the n-by-p data matrix X into k clusters, and returns an n-by-1 vector (idx) containing cluster indices of each observation. Learn more about TeamsAnswers (1) This issue could be due to RAM limitations. The appended image_domain function models the specimen as homogeneous. Have the corresponding function in MATLAB, direct call can be easily calculated. out. Different behaviour for pdist and pdist2. Copy. function Distance = euclidean (x,y) % This function replaces the function pdist2 available only at the Machine. out (jdx)=min (idx,out (idx)); end. If K is greater than MX, PDIST2 returns an MX-by-MY distance matrix. 2种计算方式,一种直接利用pdist计算,另一种. fprintf('Min Distance from pdist2() method = %f at index %d of boundary 1 and index %d of boundary 2. MY-by-N data matrix Y. matlab; vector; mahalanobis; pdist; FL93. 6GB). . With this, the proposed method and pdist2 appear to be very close (and perhaps pdist2 is faster in some regimes). The builtin function `pdist2` could be helpful, but it is inefficient for multiple timeframes data. Each row of both matrices identifies a point in 2D space. Dec 17, 2014 at 14:41. Sorted by: 1. . See the Wikipedia website. Learn more about pdist, matrix, matrix manipulation, distances MATLAB, Statistics and Machine Learning Toolbox. 4424 0. close all; % Close all figures (except those of imtool. Rows of X and Y correspond to observations, That is, it works on the ROWS of the matrices. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting!Learn more about pdist2, error, stats MATLAB Every time I want to use pdist2, I get the following error: Undefined function 'pdist2mex' for input arguments of type 'double'. dbscan identifies some distinct clusters, such as the cluster circled in black (and centered around (–6,18)) and the cluster circled in blue (and centered around (2. tic; d2 = pdist2 (p1,pn); t2 (p) = toc; end. Learn more about sørensen-dice similarity coefficient, histograms, discrete probability, discrete probability distribution, probability, distribution, sørensen-dice, sørensen-dice index, similarityCan I use the Matlab function called. com). Therefore, D1 (1) and D1 (2), the pairwise distances (2,1) and (3,1), are NaN values. I was wondering if there is a built in matlab fucntion that calculates the distance between two arrays that don't have the same column number like in pdist2? For example if matrix A was 102x3 and M. m file? Add this to the path or change working directory accordingly. Learn more about for loop, matrix, matlab, pdist MATLAB Hi everybody, i have two 3D matrix A and B with different lengths. Sorted by: 8. 0332 0. Compute the Euclidean distance. This function can do both - it will function like pdist if only one set of observations is provided and will function like pdist2 if two. Viewed 434 times 0 I'm trying to compare the histogram of an image (hsv) with a cell array that contains the histograms of other images in order to find out the closest matches. Then pdist2 should work. One immediate difference between the two is that mahal subtracts the sample mean of X from each point in Y before computing distances. D = pdist2 (X,Y) returns a matrix D containing the Euclidean distances. It seems that the pdist2 version lacks in efficiency due mainly to the element-wise squares, while Matlab now provides the 'squaredeuclidean' option to get this directly. Then execute 'memory' command in the Command Window and send the output. Hi, So if I have one 102x2 matrix of x,y coordinates, and another 102x2 matrix of x,y coordinates, can pdist be used to compare all the rows in matrix 1 with the rows in matrix 2?. 19. 2. Copy. It will not be the longest perpendicular distance along the centerline. If you want to order the points from B by their distance to the r th point in A then you can sort the r th row of the pairwise distance matrix. [labels,numClusters] = pcsegdist (ptCloud,minDistance); Plot the labeled results. It computes the distances between rows of X. It's dramatically faster than pdist2 or looping through the points but still the vast majority of runtime. ) Y = pdist (X,'. minDistance = 0. 2. This distance represents how far y is from the mean in number of standard deviations. – The distance between each sample in A and each sample in B can be calculated as follows: First, define a matrix D of size 75x50, s. Using pdist with two matrix's. 9448. Learn more about for loop, matrix, matlab, pdist MATLAB. Find the treasures in MATLAB Central and discover how the community can help. Free MATLAB and Simulink learning resources include interactive online courses, documentation and code examples, and how-to videos on product capabilities. Free MATLAB and Simulink learning resources include interactive online courses, documentation and code examples, and how-to videos on product capabilities. '); (with the transpositions required for the orientation of the matrices) To get the individual x and y distances, the easiest way I can think of is using repmat:If you don't have access to the MATLAB Mapping toolbox then a simple approximation is to use the Haversine formula. However, manually defining the cell array is a limitation here. For each observation in Y, PDIST2 finds the K smallest or largest distances by computing and comparing the distance values to all the observations in X. 注意. Answers (1) This issue could be due to RAM limitations. But pdist2 might have a lot of overhead if you only give it one pair of points. Simple speed up for pdist and pdist2 3-10x+ (only for Euclidean distance) IIRC this can be done without repmat. If you need to create a list with the indeces, see the method below to avoid loops, since that was the real time-consuming part of your code, rather than the distance method itself. between each pair of observations in the MX-by-N data matrix X and. m. I am looking for an alternative to this in. Use kmeans to create clusters in MATLAB® and use pdist2 in the generated code to assign new data to existing clusters. Note that the output will be of the size N x M x 2. View self-paced courses | Search documentation, examples, and videos. 8,. image = 1 0 0 0 0 1 0 0 0. Create a matrix with three observations and two variables. . For code generation, define an. The Canberra Distance is defined as. The cosine similarity measure has been widely studied under different information environments. Mapping Toolbox supports a complete workflow for managing geographic data. Z (2,3) ans = 0. 0. 3326 0. linux 网络的配. Contribute to MahindaMK/A-generalized-fuzzy-k-nearest-neighbor-regression-model-based-on-Minkowski-distance development by creating an account on GitHub. With this, the proposed method and pdist2 appear to be very close (and perhaps pdist2 is faster in some regimes). matlab pdist2,matlab中pdist2函数; windows 10 bash change PS1; linxu中删除指定时间之前的文件shell脚本; react中如何做成 tab 切换的效果; __declspec的英文含义; 从零复现PyTorch版(3) webpack报错:Invalid options object. Rows of X and Y correspond to observations, That is, it works on the ROWS of the matrices. Or clearvars if you want. This function fully supports thread-based environments. @all, thanks a lot. Pass Z to the squareform function to reproduce the output of the pdist function. Y = pdist (X, 'canberra') Computes the Canberra distance between the points. I need to build a for loop to calculate the pdist2 between the first row of A and all the rows of B, the second row of A and all. matlab. Matlab taking too much time in computing mex function for large array. I used this MATLAB function to compute the distance matrix Dists = pdist2(fruchterman_graph(:,:),fruchterman_graph(:,:),'euclidean'); but it fails on large networks for both speed and finally memory. ^2 + (y1 - y0). pdist2 computes the distance between all pairs of points of the two inputs. m' but I am unable to find the distance. Anyway, when you have a built-in function in Matlab, it will almost always outperform hardcoded ones so just go with pdist2. 5324 0. Z (2,3) ans = 0. tic; d2 = pdist2 (p1,pn); t2 (p) = toc; end. D1 = pdist (X) D1 = 1×3 NaN NaN 0. MY-by-N data matrix Y. xy = rand (5, 2); distances = pdist2 (xy, xy) S = sum (distances) This code will give all sum of distances between the points, now the point having minimum distance. The sorted order of tied distances in the generated code can be different from the order in MATLAB ® due to numerical precision. Improve this answer. For example, you can find the distance between observations 2 and 3. Given a matrix A of size [N,3] and a matrix B of size [M,3], you can use the pdist2 function to get a matrix of size [M,N] containing all the pairwise distances. The output is a dissimilarity matrix formatted as a row vector y, (n-1)*n/2 long, where the. % accept a matrix ZJ with an arbitrary number of observations. , (2, , corresponds to the distance between objects. One matrix has 2 sets of coordinates Answers (2) You can do this with the pdist2 function. Nov 8, 2013 at 9:26. My problem is taking those distances out of the matrix and finding the smallest combined distance for each unique set of X to Y measurements. =1-pdist2(allPairs{jj,1},allPairs{jj,2}, 'cosine'); %performs cosine similarity and puts it in a cell array. pdist2 returns the distance between each pair of observations in X and Y using the metric specified by Distance. 9437 60. It can be calculated as follows: D = A*B' + (1-A)* (1-B)'; The final distance measure can be done by testing for each pair. %. Mar 8, 2021 at 17:55. Sorted by: 4. matlab pdist2,matlab中pdist2函数; windows 10 bash change PS1; linxu中删除指定时间之前的文件shell脚本; react中如何做成 tab 切换的效果; __declspec的英文含义; 从零复现PyTorch版(3) webpack报错:Invalid options object. Accepted Answer. mat file and we'll show you how you can use pdist2() to find close points. One immediate difference between the two is that mahal subtracts the sample mean of X from each point in Y before computing distances. You can use pdist2 to compute pairwise distance between two sets of observations as follows: X = randn (200, 2); Y = randn (3, 2); D = pdist2 (X,Y,'euclidean'); % euclidean distance. Please refer to this MATLAB answer: comparison of two histograms using pdist2 - MATLAB Answers - MATLAB Central (mathworks. Learn more about graph MATLAB I have a square area of gridpoints and I'm trying to create a graph where each point is joined to its neighbouring points based on a Chebychev distance. % n = norm (v) returns the Euclidean norm of vector v. My question is why applying the mean-function over the output of pdist2() in c. Since you want number instead of percentage, multiply by the number of columns: pdist2(A,B,'hamming')*size(A,2) ans = 3 3 3 0 2 3Mahalanobis distance in matlab: pdist2() vs. 2 @ServerS Note also that pdist2 can be used with other distances, not just Euclidean – Luis Mendo. Mahalanobis distance in matlab: pdist2() vs. Let us create a matlab script called speedtest. However, I use this matrix in a loop like this : for i:1:n find (Distance (i,:) <= epsilon);. example. Computes the distance between m points using Euclidean distance (2-norm) as the distance metric between the. 9448. However, pdist2 is an optimized method to calculate the euclidean distances between points in two vectors. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting!1. 9448. pdist2() is in the Statistics and Machine. 3 Answers. between each pair of observations in the MX-by-N data matrix X and. The problem seems to be that. D = pdist2 (X,Y) returns a matrix D containing the Euclidean distances. m is interfering with use of the pdist2 from the Statistics toolbox. Sorted by: 1. Categories MATLAB Mathematics Random Number Generation. clc; % Clear the command window. Can I use the Matlab function called. A custom distance function for pdist2 needs two input arguments and the first must specify just a single observation: axa = pdist2(latlon1(1, 1:2), latlon2(:, 1:2), @haversine); % repeat for other values in latlon1I want to use the Manhattan Distance and I have a definition for it, so how the heuristic for it should be calculated, but I am not sure if it is correct. Learn more about matrix manipulation, distance, pdist2, matlab function, indexing, matrix, arrays MATLAB I was wondering if there is a built in matlab fucntion that calculates the distance between two arrays that don't have the. 6 (R2019a) Signal Processing Toolbox Version 8. This is the code which runs only on smallish graphs (not hundreds of thousands): Copy. Accepted Answer: Star Strider. x is the n x d matrix representing q row vectors of size d . Pass Z to the squareform function to reproduce the output of the pdist function. Actually, that is simply NOT the formula for Euclidean distance. Very clever - I wouldn't have thought about the pdist2 function (+1). . I'm able to get the julia single threaded function running twice as slow as matlab but a multi threaded function running twice as fast as matlab. minDistance2, index1, index2); xLine = [boundary1x(index1), boundary2x(index2)];. Or clearvars if you want. pcshow (ptCloud. pdist and pdist2 can calculate the city block distance. 8531 0. The most efficient pairwise distance computation. 欧氏距离: 也可以用表示成向量运算的形式: (4)Matlab计算欧氏距离 Matlab计算距离主要使用pdist函数。若X是一个M×N的矩阵,则pdist(X)将X矩阵M行的每一. Define an entry-point function named findNearestCentroid that accepts centroid positions and new data, and then find the nearest cluster by using pdist2. matlab中的马氏距离:pdist2()与mahal()函数,matlab,Matlab,我有两个矩阵X和Y。它们都代表三维空间中的许多位置。X是一个50*3的矩阵,Y是一个60*3的矩阵 我的问题是:为什么将均值函数与“Mahalanobis”结合应用于pdist2()的输出上,却不能给出用mahal()得. Define the center and diameter of a. I have a vector X which contain x and y value in column 1 and 2 respectively. MATLAB Graphics 2-D and 3-D Plots Discrete Data Plots. ^2). Follow. % ZI is a 1-by-n vector containing a single observation. 1 Answer. Create distance matrix from the result of pdist. de 2022 I'm trying to use the pdist2 function and keep getting this error: "??? Undefined function or method 'pdist2'. Fowzi barznji on 16 Mar 2020. See pdist2 documentation for the structure of the matrix. plot (xi,t1,'r',xi,t2,'b'); legend ( {'Manual','Pdist2'}) Which probably suggests that any differences in time between pdist2 and manual calculation are negligible and more dependent on the current background state of the CPU. function Distance = euclidean (x,y) % This function replaces the function pdist2 available only at the Machine. . Create a matrix with three observations and two. D = pdist2 (X,Y) returns a matrix D containing the Euclidean distances. Learn more about pdist2 Statistics and Machine Learning Toolbox. 9448. 1. Try something like E = pdist2 (X,Y-mean (X),'mahalanobis',S); to see if that gives you the same results as mahal. The less details have to be guessed, the more likely does the answer match your needs. md","path":"README. Compute the Euclidean distance between pairs of observations, and convert the distance vector to a matrix using squareform. ), however at the end, it shows an important message. And, in the answer, the preceding format is used. Description. Now I want to create a mxn matrix such that (i,j) element represents the distance from ith point of mx2 matrix to jth point of nx2 matrix. Generate the histogram matched output image. d = sqrt ( (X_Coord - X_Ant). Neighbors are defined as points whose Voronoi polygons share one or more (finite) vertices. The builtin function `pdist2` could be helpful, but it is inefficient for multiple timeframes data. linux 网络的配. Learn more about histogram comparison, image comparison, image segmentation, distance comparison, chi-square Image Processing Toolbox hi, I am having two Images I wanted compare these two Images by histograms I have read about pdist that provides 'chisq' but i think the way i am doing is not correct. Create distance matrix from the result of pdist. Distance functions are: pdist, pdist2, mahal, squareform, mdscale, cmdscaleIn Matlab: dist = sqrt(sum((a-b). 1. 5* (dist (x (:,2:n),x (:,n)')/ker_bw^2)); end. Z (2,3) ans = 0. Tall arrays provide a way to work with data backed by a datastore that can have millions or billions of rows. You need to rename or delete c: oolboxclassifypdist2. Use kmeans to create clusters in MATLAB® and use pdist2 in the generated code to assign new data to existing clusters. However, generally the manual calculation is slightly faster or. example. / Lab Invest 103 (2023. Hot Network QuestionsNote that v here in many MATLAB functions can be set by itself, do not necessarily have to take the standard deviation, can be based on the importance of each variable to set different values, such as the Knnsearch function in the Scale property. I'm looking for any existing code, Matlab toolkit, or whatever, to help this task: given X,Y coordinate pairs of moving discrete agents in several classes (e. Image A is a truecolor RGB image, while image Ref is a grayscale image. To do that you'd have to use the algorithm I outlined. Idx has the same number of rows as Y. MY-by-N data matrix Y. % ZI is a 1-by-n vector containing a single observation. matlab pdist2,matlab中pdist2函数; windows 10 bash change PS1; linxu中删除指定时间之前的文件shell脚本; react中如何做成 tab 切换的效果; __declspec的英文含义; 从零复现PyTorch版(3) webpack报错:Invalid options object. matlab pdist2,matlab中pdist2函数; windows 10 bash change PS1; linxu中删除指定时间之前的文件shell脚本; react中如何做成 tab 切换的效果; __declspec的英文含义; 从零复现PyTorch版(3) webpack报错:Invalid options object. It's hard to tell without knowing what dtw2 is. Learn more about histogram comparison, image comparison, image segmentation, distance comparison, chi-square Image Processing Toolbox. Would be cool to see what you have in python, and how it compares. To save memory on the device, you can separate training and prediction by using kmeans and pdist2, respectively. Neuropragmatist on 3 Aug 2019 I have run the following code several times and I get slightly different results: Theme Copy xi = 1:. Idx = knnsearch (X,Y) finds the nearest neighbor in X for each query point in Y and returns the indices of the nearest neighbors in Idx, a column vector. comparing histograms with matlab through pdist2. For code generation, define an. The most efficient pairwise distance computation. I need to develop a function to create an array of points and find the distances between every pair of points. . PostCSS Loader. how can I add a dot product as a distance function in pdist of matlab. For code generation, define an. Set the minimum Euclidean distance between clusters. Calculates the distance between sets of vectors. I followed the documentation of MATLAB where in order to calculate Mahalanobis Distance, I have to use pdist2:. To save memory on the device, you can separate training and prediction by using kmeans and pdist2, respectively. 9448. PostCSS Loader. The points are grouped into two clusters. After that I have to call the pdist2 function to measure the cityblock distance. If you want to order the points from B by their distance to the r th point in A then you can sort the r th row of the pairwise distance matrix. There appears to be a misconception here. The dot of the i will have a lower y value of its centroid than the body of the i. Sign in to comment. Idx = knnsearch (X,Y) finds the nearest neighbor in X for each query point in Y and returns the indices of the nearest neighbors in Idx, a column vector. y both form part of multidimensional coordinates for a single multidimensional point node(i) and likewise there is a single multidimensional point designated for node(j) and you want to find the multidimensional distance, then you would need different code (and you would need to. % n = norm (v) returns the Euclidean norm of vector v. e. pdist2 is optimized to return the distance from each of the points in the first argument to each of the points in the second argument, so if you only want one distance then only pass a single point to each. Function File: pdist2 (x, y) Function File: pdist2 (x, y, metric) Compute pairwise distance between two sets of vectors. out = 1×10. How to find closest Lat/Lon on a grid to an. pdist2 Pairwise distance between two sets of observations. Share. for example,I have a binary image like this. @Image Analyst Hello, I tried to find the minimum distance bewteen two objects as per the code you provided on a similar post- 'test3. function out = myAngDiff (alpha,beta) out = zeros (length (beta),1); for i=1:length (beta)If you have Statistics and Machine Learning Toolbox, you can simply use pdist2 to do that. If you want the cosine, use 1-pdist2 (matrix1,matrix2,'cosine'). ) clear; % Erase all existing variables. There appears to be a misconception here. For example, you can find the distance between observations 2 and 3. D = pdist2(x, y) < 10; D(1:size(D,1)+1:end) = 0; G = graph(D); C = conncomp(G); The connected components is vector that shows the cluster numbers. function Distance = euclidean (x,y) % This function replaces the function pdist2 available only at the Machine. One way is to call regionprops() to get the centroids of the two blobs. . ^2));. 0. However, generally the manual calculation is slightly faster or. rng ( 'default') % For reproducibility X = rand (3,2); 计算欧几里德距离。. m is interfering with use of the pdist2 from the Statistics toolbox. Not super efficient, but does its work. Generate C code that assigns new data to the existing clusters. Learn more about for loop, matrix, matlab, pdist MATLAB Hi everybody, i have two 3D matrix A and B with different lengths. . Mahalanobis distance in Matlab I would like to calculate the mahalanobis distance of input feature vector Y (1x14) to all feature vectors in matrix X (18x14). distfun must. pdist2 Pairwise distance between two sets of observations. Hi, So if I have one 102x2 matrix of x,y coordinates, and another 102x2 matrix of x,y coordinates, can pdist be used to compare all the rows in matrix 1 with the rows in matrix 2?. distances_max = pdist2(pks_max,pks_max); % Find out which pairs are within 1 of each other. rema on 16 Feb 2023. Mahalanobis distance has no meaning between two multiple-element vectors. Learn more about pdist2 Statistics and Machine Learning ToolboxIn Matlab there exists the pdist2 command. pdist2 Pairwise distance between two sets of observations. It computes the distances between rows of X. Matlab pdist2 : Out of memory. 5 multi threads - foo4() (see below) - 4. This function does the same thing, but also. It computes the distances between rows of X. tic; d2 = pdist2 (p1,pn); t2 (p) = toc; end. 0. In oppsite to this, sqrt(sum(t . Generally, average cosine similarity values are used to find the degree of similarity between two. Function Reference: pdist. Learn more about color-histogram MATLABUse pdist2 () to return an index of second smallest value in matrix. p1 is a matrix of points and p2 is another matrix of points (or they can be a single point). squareform returns a symmetric matrix where Z (i,j) corresponds to the pairwise distance between observations i and j. In this workflow, you must pass training data, which can be of considerable size. Just wanted to let you know that pdist2 in MATLAB uses 'Euclidean' distance by default. 1482 0_pdist2 matlab. What I want to do is like calculate the kernel matrices like calculating the. % Learning toolbox. Mahalanobis distance in matlab: pdist2() vs. The Mahalanobis distance from a vector y to a distribution with mean μ and covariance Σ is. PixelList); [mindist, minind] = min (distances (:)); %// Now convert this linear index into index1/index2 into your pixel lists. The Chebyshev distance between two n-vectors u and v is the maximum norm-1 distance between their respective elements. PostCSS Loader. mahal returns the squared Mahalanobis distance. 2. In the file. the square computational domain discretized with N = 16 × 1 0 4 Halton points according to the Daniel Dougherty’s haltonseq Matlab code [38]. The whole kicker is you can simply use the built-in MATLAB function, pdist2(p1, p2, ‘euclidean’) and be done with it. 5 seconds julia 0. Use kmeans to create clusters in MATLAB® and use pdist2 in the generated code to assign new data to existing clusters. In Matlab, the D = pdist(X, Y) function computes pairwise distances between the two sets of observations X and Y. , is a. * pdist2 (X,Y,'euclidean'). if i go like this the matrix size increase, so I want to reduce minutiae information which is in row. 1. [D,I] =. ^2 + (Y_Coord - Y_Ant). It will take the distance between the two sets at the beginning. distfun must accept a matrix XJ with an arbitrary number of rows. D = pdist2 (X,Y) returns a matrix D containing the Euclidean distances. This MATLAB function performs k-means clustering to partition the observations of the n-by-p data matrix X into k clusters, and returns an n-by-1 vector (idx) containing cluster indices of each observation. com). I am not sure if the dice function can be used to compare two histograms, but you can use the function pdist2 to get a similarlity score between the histograms. If you need to create a list with the indeces, see the method below to avoid loops, since that was the real time-consuming part of your code, rather than the distance method itself. Learn more about pdist, matrix, matrix manipulation, distances MATLAB, Statistics and Machine Learning Toolbox. I have a trajectory like this: We assume that each red star marker can broadcast its coordinate to the green circle markers which are located within a radius of 5 units from its own position. I'm able to get the julia single threaded function running twice as slow as matlab but a multi threaded function running twice as fast as matlab. squareform returns a symmetric matrix where Z (i,j) corresponds to the pairwise distance between observations i and j. y = squareform (Z)For example the not weighted RBF and sigmoid kernel can be computed as follows: K_rbf = exp (-gamma . AnyLogic. Now what happens sometimes, seemingly at random, is that instead of getting the distance, the value that is calculated gets shown as 'NaN'. . m. pdist. map=logical (map+map. There are two main classes: pdist1 which calculates the pairwise distances between observations in one matrix and returns a distance matrix. % Learning toolbox. Find more on Discrete Data. Both images are of data type uint8. pcshow (ptCloud. You will want the second output of min (combined with ind2sub) to determine the row/column of the pdist2 matrix that corresponds to the minimum distance. For example, you can find the distance between observations 2 and 3. pdist (Statistics Toolbox) Y = pdist (X,' Y = pdist (X,distfun,p1,p2,. . Generate C code that assigns new data to the existing clusters. Dear Gentlemen i face problem when i use pdist2 function of hamming distance between two binary images in same size, the output result is an array not a percentage value, where i want to use hamming distance to calculate the percentage difference between two binary images:There is a file at c: oolboxclassifypdist2. The points are grouped into two clusters. What complicates things even more is the fact, that I have to exclude the current point (to which I'm trying to find the closest one); that's the purpos of my 'others' variable and the 2 pieces of code above and below the for-cycle.