Getting current position (x,y) of a 2D object created with a patch
3 ビュー (過去 30 日間)
古いコメントを表示
x = [-9 , 3, 1, 9, 1, 3, -9 ];
y = [-3,-3,-9/2, 0, 9/2, 3, 3];
g = hgtransform;
patch('XData',x,'YData',y,'FaceColor','yellow','Parent',g)
The patch moves consistently through the plot, at 2 points it stops to correct its angle. Is there anyway to get a hold of its current x&y positions at that point for further use?
0 件のコメント
回答 (1 件)
sloppydisk
2018 年 5 月 11 日
p = patch('XData',x,'YData',y,'FaceColor','yellow','Parent',g);
p.Vertices
This should do it.
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!