MATLAB: Can recognize what distance is this

euclidean distance

Can anyone explain me what does this code do,
Could it be the after first if is calculated euclodean distance and in else there is second distance called mahalanobis distance ?

Best Answer

The clue is in the name of the variable: useL1Distance . If it is true, then the L1 norm is used, which is also called "taxi-cab distance".
If it is false, then the L2 norm is used, which is also called Euclidean distance.
Neither branch has anything to do with maholonobis distance.