how can i draw a circle useing patch function?
17 次查看(过去 30 天)
显示 更早的评论
how can i use patch funtion to draw a circle or ellipse
0 个评论
回答(2 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polygons 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!