Distance from points to points.
Show older comments
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 Comment
Image Analyst
on 8 Feb 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)?
Accepted Answer
More Answers (1)
Francesco
on 8 Feb 2014
0 votes
2 Comments
Image Analyst
on 8 Feb 2014
Edited: Image Analyst
on 8 Feb 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
on 9 Feb 2014
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!