version (1.47 KB) by Thomas
Computes the 3D distance between two 3D point sets


Updated 6 Aug 2013

View License

INPUT: two sets of matching column vectors, x1, y1, z1 & x2, y2, z2 representing xyz coordinates of two 3D point sets. E.g:


OUTPUT: Single column vector, euclidV3D, with each row being the 3D distance between each position vector in the two point sets. E.g.

euclid3D=[1.7321; 1.7321; 1.7321]

USAGE: [euclidV3D] = euclideanV(x1, y1, z1, x2, y2, z2)

Function avoids for loops and is thus faster than the previously submitted function, euclidean (though less useful for higher dimension arrays).

Cite As

Thomas (2022). euclideanV (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!