How to find the center point in this plot?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sabarinathan Vadivelu
el 12 de Feb. de 2013
Comentada: Cameron Burgoni
el 9 de Abr. de 2018
This is my plot. How to find the center point available in this plot?

4 comentarios
Respuesta aceptada
Walter Roberson
el 13 de Feb. de 2013
minx = min(x);
maxx = max(x);
centx = (minx + maxx) / 2;
miny = min(y);
maxy = max(y);
centy = (miny + maxy) / 2;
dist2 = (x - centx).^2 + (y - centy).^2;
[mindist2, idx] = min(dist2);
bestx = x(idx);
besty = y(idx);
0 comentarios
Más respuestas (1)
Thorsten
el 12 de Feb. de 2013
x = rand(1,100);
y = rand(1,100);
plot(x, y, 'r*')
hold on
plot(mean(x), mean(y), 'k*', 'MarkerSize', 20)
2 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!