1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 19:36:26 +02:00
Files
uni/bv/hist_dist_Manhattan.m
2016-11-01 14:24:07 +01:00

15 lines
314 B
Matlab

function [ distance ] = hist_dist_Manhattan( h1, h2 )
%HIST_DIST_MANHATTAN Calculates the Manhattan distance between 2 histograms
distance = 0;
s = size(h1);
if s(1) > 1
n = s(1);
else
n = s(2);
end
for i = 1:n
distance = distance + abs(h1(i) - h2(i));
end
end