
how to paint a circle?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ana Beatriz Baptista
il 17 Dic 2020
Risposto: Star Strider
il 17 Dic 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 Commenti
Risposta accettata
Star Strider
il 17 Dic 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Line Plots 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!