how to paint a circle?

2 visualizaciones (últimos 30 días)
Ana Beatriz Baptista
Ana Beatriz Baptista el 17 de Dic. de 2020
Respondida: Star Strider el 17 de Dic. de 2020
It's possible I draw a circle and then paint it all not only the line?
Imagine I do that:
x1=@(x) 6+sqrt(2-(x-1.5)^2);
x2=@(x) 6-sqrt(2-(x-1.5)^2);
hold on
fplot(x1, [0 15])
fplot(x2,[0 15])
axis equal
axis equal off
hold off
How can I paint inside of the circle?

Respuesta aceptada

Star Strider
Star Strider el 17 de Dic. de 2020
Try this:
x1=@(x) 6+sqrt(2-(x-1.5)^2);
x2=@(x) 6-sqrt(2-(x-1.5)^2);
hold on
v1 = fplot(x1, [0 15]);
v2 = fplot(x2,[0 15]);
fill([v1.XData v2.XData], [v1.YData v2.YData], 'g', 'EdgeColor','g') % Fill The Circle
axis equal
axis equal off
hold off
producing:
Note that fplot is not the best option for this, so ther is a small gap.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by