let assume I have A matrix in which there are m points and B matrix in which n points are there
I have a point lets say m1(x,y) in A matrix ,I want to find its closest/correspondent point in B matrix and after that want to differentiate the y coordinates of m1 point and its closest point
then taking m2(x,y) of A matrix finding it closest point in B matrix and diffrentiate and so on for each point in A matrix i want closest point in B matrix and diffrentiate their repsective y coordinates
I have tries some function/code like
1)"k = dsearchn(X,XI)"
2)
A = rand(1,2);B = rand(10,2);%compute Euclidean distances:
distances = sqrt(sum(bsxfun(@minus, B, A).^2,2));%find the smallest distance and use that as an index into B:
closest = B(find(distances==min(distances)),:);
but didnt get the desired result
I am using matlab2014a
Best Answer