Distance from points to points.
Mostrar comentarios más antiguos
If I have this variable:
cord_new =
0.7000 0.4000
0.4500 0.3700
0.1000 0.6000
[righe, colonne]=size(cord_new)
gplot(ones(righe), cord_new, '-bs');
How can I plot the first value of cord_new with the second value of cord_new and the third value of cord_new. The important thing is that the first element is always fixed.
1 comentario
Image Analyst
el 8 de Feb. de 2014
It's a 2D array, so exactly which element do you consider to be the third value? 0.1 (going down the row), or 0.45 (going across first, then down)?
Respuesta aceptada
Más respuestas (1)
Francesco
el 8 de Feb. de 2014
0 votos
2 comentarios
Image Analyst
el 8 de Feb. de 2014
Editada: Image Analyst
el 8 de Feb. de 2014
So get rid of the bar chart. I only did it because you said you want to "plot the distance of the first to the second, the first to the third and so" and so I plotted the distances like you asked at first. Distance is computer via the Pythagorean theorem - not sure if you have a different definition than the rest of us. Maybe you meant "path" or "connecting line"??? If you don't want the distances anymore and only want the connecting lines, then get rid of all subplots and the call to bar and its labels and titles. And like I said, you can use whatever colors you want. You don't have to use rand(1,3) to get a random color like I did.
Francesco
el 9 de Feb. de 2014
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
