필터 지우기
필터 지우기

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!

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 CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by