matlab function of mandist

mandist (A, B) of each function is used to find the row vector A and B to each column vector in theAbsolute distance

EG 1 :

a = [1,2,3] b = [-1,5,6] c = [1,0,1]
mandist(a,b’) = 8

Explanation:
(1) b 'indicates a transposed matrix b
(2) requires: mandist two parameters represent two matrices, the number of columns of the first matrix = number of rows of the second matrix
(3) is calculated: | 1 - (- . 1) | + | 2-5 | + | 3-6 | =. 8
(. 4) dimension: the number of columns the number of rows = number of rows in the first matrix, the number of columns of the second matrix =

Exercise:
mandist (A, C ') = | 1-1 of | + | 2-0 | + | 3-1 | =. 4
mandist (C, B') = |. 1 - (-. 1) | + | 0-5 | + | 1-6 | = 12

EG 2 :

A = [1,2,3
—— 4,5,6]
mandist(A,A’) = [0,9
——————— 9,0]

Explanation:
(1) dimension: A (2,3), A '(3,2)

A’ = [1,4
——2,5
——3,6]

(2) Order mandist = X (A, A ')
(. 3) is calculated:
X (1,1) = | 1-1 of | + | 2-2 | + | 3-3 | = 0
X (1,2) = | 1-4 | + | 2-5 | + | 3-6 | =. 9
X (2,1) = | 4-1 | + | 5-2 | + | 6-3 |. 9 =
X (2, 2) = | 4-4 | + | 5-5 | + | 6-6 | = 0

Exercise:
Y = mandist (A ', A) = [0,2,4
--------- 2,0,2
--------- 4,2,0]
Calculation:
Y (1,1) = | 1-1 of | + | 4-4 of | 0 =
Y (1,2) = | 1-2 | + | 4-5 | = 2
Y (l, 3) = | 1-3 | + | 4-6 | =. 4
Y (2,1) = ...

supplement
mandist(A) = mandist(A’,A)
mandist(A’) = mandist(A,A’)

Published 29 original articles · won praise 3 · Views 966

Guess you like

Origin blog.csdn.net/weixin_44813932/article/details/96570757