Azzera filtri
Azzera filtri

creating loop for 3d matrix

1 visualizzazione (ultimi 30 giorni)
Mayank Lakhani
Mayank Lakhani il 2 Mar 2016
Modificato: Mayank Lakhani il 2 Mar 2016
I have two 3D matrix below.
Original_data = cat(3, O_range, O_Doppler, O_Angle);
Measured_data = cat(3, M_range, M_Doppler, M_angle);
below is a m.file for nearest distance calculation between O_range and M_range. How to include O_Doppöer, O_Angle, M_Doppler and M_angle from 3D matrix to the loop.
function [ res ] = nearest_Distance( O_range, M_Range, Number_of_object)
res=nan(size(O_range,1),Number_of_object);
for ix = 1:Number_of_object
dist = abs(bsxfun(@minus,M_Range,O_range(:,ix)));
[~,col] = min(dist,[],2);
res(:,ix) = diag(M_range(:,col));
end
end

Risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by