how can i draw a circle useing patch function?

18 ビュー (過去 30 日間)
Ameen salamy
Ameen salamy 2016 年 4 月 4 日
回答済み: Chad Greene 2016 年 4 月 4 日
how can i use patch funtion to draw a circle or ellipse

回答 (2 件)

Star Strider
Star Strider 2016 年 4 月 4 日
This works:
t = linspace(0, 2*pi);
r = 1;
x = r*cos(t);
y = r*sin(t);
figure(1)
patch(x, y, 'g')
axis equal
The code for an ellipse would be the same, except that there would be different values of ‘r’ for the ‘x’ and ‘y’ calculations.

Chad Greene
Chad Greene 2016 年 4 月 4 日
You can use circles to do it.

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by