finding x and y coordinates

1 次查看(过去 30 天)
I have a plot on matlab with points on the plot. I would like to find the x,y coordinates of these points. How do I do that? I want to eventually calculate the euclidean distance of points using the function distance square root (x^2 +y^2). I have no problem getting the x-coordinate indices, but I cannot get the y. I know you can use tools and data cursor to get the x and y coordinates. but i would like to hard code this.
Thank you

采纳的回答

Steven Lord
Steven Lord 2016-11-16
Obtain the handle of the line, scatter plot, etc. in your figure. The findobj or allchild functions may be of use to you in this step. Then retrieve the properties of that object that contain the data. Usually those properties are called XData, YData, and ZData but it may be slightly different for different objects. Use get to show the list of properties and/or look at the documentation for the object whose handle you have for a list and an explanation of the properties.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by