Effacer les filtres
Effacer les filtres

finding x and y coordinates

1 vue (au cours des 30 derniers jours)
Osita Onyejekwe
Osita Onyejekwe le 16 Nov 2016
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

Réponse acceptée

Steven Lord
Steven Lord le 16 Nov 2016
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.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by