pdist_oneLine

One-line implementation of both MATLAB's pdist and pdist2 functions.

You are now following this Submission

My one-line implementation of both MATLAB's pdist and pdist2 functions which compute the univariate (pdist) or bivariate (pdist2) Euclidean distances between all pairs of input observations. This function can do both - it will function like pdist if only one set of observations is provided and will function like pdist2 if two sets of obsrvations are provided. Additional input arguments are NOT supported such as alternative distance metrics.
GitHub: https://github.com/andrewsoltisz/pdist-one-line/tree/main

Cite As

Andrew M. Soltisz (2026). pdist_oneLine (https://www.mathworks.com/matlabcentral/fileexchange/136559-pdist_oneline), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.2

added GitHub link to the description.

1.0.1

added mathworks file exchange link to the source code

1.0.0