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

16 visualizaciones (últimos 30 días)
Tai-Yen Chen
Tai-Yen Chen el 18 de Jul. de 2012
Respondida: Ana Gonçalves el 24 de Mayo de 2022
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.

Respuestas (2)

Walter Roberson
Walter Roberson el 18 de Jul. de 2012
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 comentarios
Tai-Yen Chen
Tai-Yen Chen el 18 de Jul. de 2012
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 el 18 de Jul. de 2012
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.

Iniciar sesión para comentar.


Ana Gonçalves
Ana Gonçalves el 24 de Mayo de 2022
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

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by