MATLAB: What do I need to add to this code to fill the circle with color

circle color filled

How can I create a circle filled with a color?

Best Answer

You almost answered your own Question. Use the fill function:
t = linspace(0, 2*pi);
r = 1;
x = r*cos(t); % Circle Coordinates

y = r*sin(t); % Circle Coordinates
figure(1)
fill(x, y, 'y')
axis equal
Related Question