Getting current position (x,y) of a 2D object created with a patch
조회 수: 9 (최근 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에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!