# I have followwing code in which xn = (x1,y1)& yn= (x2,y2) coordinates.Distance between each (x1,y1) and (x2,y2) is greater than 22.i want (x,y) coordinates, condition is distances between every coordinate to all other coodinates should be >22

2 views (last 30 days)
M.Prasanna kumar on 4 Feb 2019
Edited: M.Prasanna kumar on 4 Feb 2019
F = [x5;y5]'; %% x,y coordinates
D = pdist(F);
indx = squareform(D)>22;
[p1,p2] = find(triu(indx));
xn = F(p1 , :);
yn = F(p2 , :);
distances between every coordinate to all other coodinates should be greater than 22. that means all possible distances distances between any coordinate point to every other coodinate point should be greater than 22
##### 2 CommentsShowHide 1 older comment
M.Prasanna kumar on 4 Feb 2019
i am getting xn is n*2 matrix and yn is n*2 matrix . (n = 474192)
1. distance between first row of xn and first row of yn is greater than 22.
2. distance between second row of xn and second row of yn is greater than 22.
3. and so on.....
at a time it is checking distance with only one coordinte. but i want (x,y) coordinates which are at a distance greater than 22 from each coordinate to every other coodinate. so that all possible distances between all coordinates should be graeter than 22