
how to paint a circle?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuesta aceptada
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.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!