Matlab Function to produce data from points
이전 댓글 표시
Hi
The question i have is say i have a starting position (x and y) (2D)
following that i have 2 colums of randomly generated points to act as x and y (rand(20,1),rand(20,1) for other coordinates
function inputs(x,y,c1,c2) if that makes sense (where c1= rand(20,1 and c2= rand(20,1)
with this infomation im looking to calcualte some data resulting in from the starting position the closest point from the c1 and c2 and from that positon the next one and next one until i find a 'path' that would display for example (1,5,2,6,9,17,13...) to find the shortest distance between all points
is there any possibility to do this?
any advice appreciated
댓글 수: 2
Jan
2021년 3월 25일
The concatenation of the shortest paths is not necessarily the shortest path over all points, is it?
But of course it is possible to do, what you are asking for. Use pdist() and sort the values.
Samuel Shlong
2021년 3월 25일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!