CITY_BLOCK_CVIP
city_block_cvip() - calculates the city block distance between feature vectors.
Contents
SYNTAX
d = city_block_cvip( vector1, vector2)
Input Parameters include :
- vector1 - Feature vector 1. A numeric row or column vector.
- vector2 - Feature vector 2. A numeric row or column vector.
Output Parameter include:
- d - cityblock distance between two vectors.
DESCRIPTION
This function calculates the city block or absolute value distance measure from the elements of the two arrays x and y.
The city block distance for two vector x, and y is defined as:
REFERENCE
1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.
EXAMPLE
% input vectors vector1 = [1 3 4 2]; vector2 = [-3 3.2 sqrt(2) pi]; % city block distance between two vectors. d = city_block_cvip( vector1, vector2); fprintf('city block distance: %d', d);
city block distance: 7.927379e+00
CREDITS
Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott
E Umbaugh
For updates visit CVIP Toolbox Website