find where two dataset intersect or get closer
Show older comments
Dear all,
I have two dataset composed by two arrays, xydata and xyfunction. The first is a 10x2 matrix (data1), the second is a 300x2 matrix (data2). In the two columns of both dataset are the x and y coordinates.

Since now I used without problem the function [xi,yi] = polyxpoly(x1,x2,y1,y2), but now the result is an empty matrix
>> whos xydata
Name Size Bytes Class Attributes
xydata 10x2 160 double
>> whos xyfunction
Name Size Bytes Class Attributes
xyfunction 300x2 4800 double
[xi,yi] = polyxpoly(xdata,ydata,xfunction,yfunction)
xi =
0×1 empty double column vector
yi =
0×1 empty double column vector
The problem is that, If i get closer and zoom, I can observe the really the two dataset don't cross each other.

Does anyone know a function which find the closer point between two arrays or datasets?
Thanks a lot!
Accepted Answer
More Answers (0)
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!