Minimum Distance loop between 'n' number of points

Version 1.1.0.0 (1.07 KB) by Rohit
This functions finds minimum distance loop between no.of points using the distance formula.
1.3K Downloads
Updated 19 Nov 2008

No License

Function to find the minimum distance loop from given set of points.
This function uses the distance formula to genrate a minimum distance loop.
function mindist = minimumdistance(X,Y,x,y)
X = X coordinate vector
Y = Y coordinate vector
(x,y) point where the loop is to be started
This point is labeled as 1 and then the rest in (X,Y) starting from 2 onwards
mindist = final value of the minimum distance from point (x,y) to (x,y)
(This function uses the distance formula directly and no algorithms as such. Any suggestions to improve the code are most welcome)

Cite As

Rohit (2024). Minimum Distance loop between 'n' number of points (https://www.mathworks.com/matlabcentral/fileexchange/22039-minimum-distance-loop-between-n-number-of-points), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Traveling Salesman (TSP) in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Made the script into a function, included a subplot showing the points and the loop.

1.0.0.0