What is wrong in the below codes which describes circles and lines in matlab?

327 Views Asked by At

I have drawn two lines. But , when I try to draw a circle on it, it doesn't work.

a(1:400,1:400,1:3)=255;
a(200,1:400)=0;
a(1:400,200)=0;
imshow(a);

It works perfectly. But while I execute the below codes to draw a circle, the above lines vanish from the figure.

centrepoint=[a(200),a(200)];
viscircles(centrepoint,198);

What is wrong in my codes?

1

There are 1 best solutions below

0
On BEST ANSWER

Not sure what you mean. When executing your code I get: enter image description here

When executing:

figure(1);
a(1:400,1:400,1:3)=255;
a(200,1:400)=0;
a(1:400,200)=0;
imshow(a);
centrepoint=[200,200];
viscircles(centrepoint,198);

I get:enter image description here