finding x and y coordinates
2 ビュー (過去 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
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!