Calculating global nearest neighbour (GNN) in Matlab

5 visualizaciones (últimos 30 días)
Mayank Lakhani
Mayank Lakhani el 22 de Feb. de 2016
Comentada: Jacobo Levy Abitbol el 6 de Jun. de 2016
I have two data matrix. One is original data and another is measured data of radar sensor. I want to find out global nearest neighbor (GNN) of the original data from the measured data. I have already calculated the Local nearest neighbor and posted the m file below. My question is how to change it in to Global nearest neighbor.
Number_of_object = 5;
Measured_data = f_range_m(1:numSuperpulsesPerCycle_g:length(timeline_ms),:);
Original_data = OrgiRange(1:numSuperpulsesPerCycle_g:length(timeline_ms),:);
Result_Range= nearest_Distance(Original_data,Measured_data, Number_of_object);
m file for the nearest_Distance (Local nearest neighbor) is give below
function [ res ] = nearest_Distance( Original_data, Measured_data, Number_of_object)
res=nan(size(Original_data,1),Number_of_object);
for ix = 1:Number_of_object
%dist = abs(bsxfun(@minus,Measured_data,Original_data(:,ix)));
dist = abs(bsxfun(@minus,Measured_data,Original_data(:,ix)));
[~,col] = min(dist,[],2);
res(:,ix) = diag(Measured_data(:,col));
end
end
  1 comentario
Jacobo Levy Abitbol
Jacobo Levy Abitbol el 6 de Jun. de 2016
Check Munkres algorithm for rectangular matrices in file exchange and apply it to your distance matrix to get the GNN optimal assignment

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by