Borrar filtros
Borrar filtros

Finding closest point to known coordinates

1 visualización (últimos 30 días)
Mehmet Volkan Ozdogan
Mehmet Volkan Ozdogan el 20 de Mzo. de 2019
Comentada: Star Strider el 21 de Mzo. de 2019
Hi,
I want to find a coordinate which has minimum distance to other coordinates,
For example;
I want to find a coordinate (a,b) which has minimum distance to coordinates given below
x y
1 2
1 4
3 2
4 2

Respuesta aceptada

Star Strider
Star Strider el 20 de Mzo. de 2019
The minimum distance of a set of points is the Centroid (link), defined as the mean of the coordinates of the points:
xy = [1 2
1 4
3 2
4 2];
minDist = mean(xy);
figure
plot(xy(:,1), xy(:,2), 'pg')
hold on
plot(minDist(1), minDist(2), 'rp')
hold off
grid
axis equal
Experiment toi get the result you want.
  6 comentarios
Mehmet Volkan Ozdogan
Mehmet Volkan Ozdogan el 21 de Mzo. de 2019
Thank you again
Sincerely
Star Strider
Star Strider el 21 de Mzo. de 2019
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by