Search code examples
matlabgeometrycomputational-geometry

How to calculate the distance between two vectors of 6 elements?


I have two vectors, V1 and V2 where:

 V1 = [0.0084    0.1871    0.1033    0.3332    0.3156    0.0524];
 V2 = [0.0176    0.2079    0.1245    0.2954    0.2510    0.1036];

How do I calculate the distance geometry between the two vectors ?


Solution

  • The distance is given by the norm of the difference. In MATLAB:

    norm(V1-V2)