get(x,y) coordinates from rectangle function in matlab

조회 수: 4 (최근 30일)
Tai-Yen Chen
Tai-Yen Chen 2012년 7월 18일
답변: Ana Gonçalves 2022년 5월 24일
Hi, I use rectangle function to draw a rectangle with two ends curved using following codes:
Rec = rectangle('Position',[1,1,10,5],'Curvature',1);
Will it be possible to get the (x,y) coordinate matrix of Rec?? Thanks for the help.

답변 (2개)

Walter Roberson
Walter Roberson 2012년 7월 18일
What is "the (x,y) coordinate matrix" of Rec ?
You can get() the Position property of Rec to retrieve the [1,1,10,5]
  댓글 수: 4
Tai-Yen Chen
Tai-Yen Chen 2012년 7월 18일
Hi Walter, This did not provide the feature of the curved part though. I think I address my question more precisely as how to get the xy of a "curved rectangle"
Walter Roberson
Walter Roberson 2012년 7월 18일
Sorry, I did not notice about that.
I do not know of any method to extract the coordinates. There might be one that is not obvious, but I cannot test that at this time.

댓글을 달려면 로그인하십시오.


Ana Gonçalves
Ana Gonçalves 2022년 5월 24일
To get the coordinates, just follow the index of the array:
r = rectangle('Position',[20 -3 10 10]);
r.Position(1) % x value
ans = 20
r.Position(2) % y value
ans = -3

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by