# Fill area of 2dcircle with cross line

5 visualizzazioni (ultimi 30 giorni)
krishan Gopal il 10 Dic 2021
Commentato: Image Analyst il 11 Dic 2021
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')
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Matt J il 10 Dic 2021
This FEX submission looks applicable:
##### 2 CommentiMostra NessunoNascondi Nessuno
krishan Gopal il 11 Dic 2021
yes, crosshatch_poly works perfect
Image Analyst il 11 Dic 2021

Accedi per commentare.

### Più risposte (1)

Awais Saeed il 10 Dic 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')
##### 3 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Awais Saeed il 10 Dic 2021
Not exactly the same but somewhat near to the desired output
theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
plot(x,y,'black')
for ii = 1:2:length(x)
line([-y(ii),x(ii)],[-x(ii),y(ii)],'Color', 'black','LineWidth',1)
end
axis('equal');
xlabel('x')
ylabel('y')
krishan Gopal il 10 Dic 2021
thankyou sir

Accedi per commentare.

### Categorie

Scopri di più su AI for Wireless in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by