https://github.com/gaolinorange/SDMNET_stamp
Tip revision: 5208f1210b77e3251dde3bdafc120a48dc69e833 authored by wutong on 27 March 2021, 07:58:47 UTC
Update ReconstructFromCodeMixIntegerReadingObjinAdvance.m
Update ReconstructFromCodeMixIntegerReadingObjinAdvance.m
Tip revision: 5208f12
get_direction.m
function [direction] = get_direction(A, B)
distances = pdist2(A, B);%calculate the distance between 2 datasets
minDistance = min(distances(:));%find the minimum value of distance
[rowOfA, rowOfB] = find(distances == minDistance);
A_coord_closest=A(rowOfA,:);
B_coord_closest=B(rowOfB,:);
direction = A_coord_closest - B_coord_closest;
end