Plotting a circel using fill funtion

1 回表示 (過去 30 日間)
Stinelino
Stinelino 2015 年 2 月 24 日
コメント済み: Jos (10584) 2015 年 2 月 26 日
I have to use the "fill" funtion to plot a circel. but i cant figure out how. I need to plot two circels. A red one with radius 0.1 and a blue one with radius 0.2.

採用された回答

Star Strider
Star Strider 2015 年 2 月 24 日
Here’s a green one with radius = 0.5 to get you started. You will also need to read the documentation on the hold function.
Example:
t = linspace(0, 2*pi);
r = 0.5;
x = r*cos(t);
y = r*sin(t);
figure(1)
fill(x, y, 'g')
axis([-1 1 -1 1])
axis square
  2 件のコメント
Chad Greene
Chad Greene 2015 年 2 月 24 日
Stinelino: If Star Strider's solution solved your problem, kindly choose "Accept this Answer" to give credit where credit is due.
Star Strider
Star Strider 2015 年 2 月 24 日
Thank you, Chad!

サインインしてコメントする。

その他の回答 (2 件)

Stinelino
Stinelino 2015 年 2 月 24 日
Thanks you so much! i think i'll be able to figure it out from here!
  1 件のコメント
Star Strider
Star Strider 2015 年 2 月 24 日
My pleasure!

サインインしてコメントする。


Jos (10584)
Jos (10584) 2015 年 2 月 24 日
You might also be interested in learning about the function rectangle, as in:
rectangle('curv',[1 1],'position',[0 0 1 1],'facecolor','b','edgecolor','b')
(Yeah, I know, sounds weird to draw a circle with rectangle ...)
  2 件のコメント
Chad Greene
Chad Greene 2015 年 2 月 26 日
...or perhaps more intuitively, circles.
Jos (10584)
Jos (10584) 2015 年 2 月 26 日
nice one, Chad!

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by