MATLAB: How to paint a circle

circlecolor

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?

Best Answer

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.