MATLAB Answers

how to find cityblock distance?

38 views (last 30 days)
hp
hp on 2 Oct 2018
Commented: Fowzi barznji on 16 Mar 2020
how to find the city block distance between feature vectors to query image feature vector, in matlab2013?

Answers (3)

Jan
Jan on 2 Oct 2018
pdist and pdist2 can calculate the city block distance.

Fowzi barznji
Fowzi barznji on 16 Mar 2020
x=[1 3 9 6 4 2 6 8 3 6];
y=[4 -2 6 8 8 3 7 2 1 1];
cityblockvalue = sum((abs(x - y)));
cityblockvalue= 32
  3 Comments
Fowzi barznji
Fowzi barznji on 16 Mar 2020
100% right
thanks to your skill

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!