Plot to a central point?

I'm having some issues getting my script to plot two vectors to a central point on a graph. Here is what I have so far.
I basically want the plot to create lines to the central red point only and not to each other. Can anyone help me with this?

 Respuesta aceptada

Roger Stafford
Roger Stafford el 6 de Sept. de 2013
Editada: Roger Stafford el 6 de Sept. de 2013

1 voto

n = length(xcoords);
px(1:2:2*n-1) = xcoords;
px(2:2:2*n-2); = xcenter;
py(1:2:2*n-1) = ycoords;
py(2:2:2*n-2); = ycenter;
plot(px,py,'y-')

1 comentario

jerry
jerry el 6 de Sept. de 2013
Ooo, so that's how it's done! You basically created a separate vector that had the original values but placed empty slots inbetween each value so that you could replace them with the center values and shifted the center point. Then you just plotted it back and forth from each point.
Thank you very much!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Preguntada:

el 6 de Sept. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by