finding x and y coordinates

2 ビュー (過去 30 日間)
Osita Onyejekwe
Osita Onyejekwe 2016 年 11 月 16 日
回答済み: Steven Lord 2016 年 11 月 16 日
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 Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by