Fill area of 2dcircle with cross line

5 views (last 30 days)
below is simple circle code, can anyone tell me how to fill this circle with line pattern.
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
plot(x,y)
axis('equal');
xlabel('x')
ylabel('y')
title('circle of unit radius')

Accepted Answer

Matt J
Matt J on 10 Dec 2021
  2 Comments
Image Analyst
Image Analyst on 11 Dec 2021
Then could you please award Matt "Reputation points" by clicking the "Accept this answer" link? Thanks in advance. 🙂

Sign in to comment.

More Answers (1)

Awais Saeed
Awais Saeed on 10 Dec 2021
Do not know how to fill with lines, but you can fill the circle as shown below
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
fill(x,y,'g')
axis('equal');
xlabel('x')
ylabel('y')
title('circle of unit radius')
  3 Comments

Sign in to comment.

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!