MATLAB: How to generate a circle within a digital image

digital image processingimageMATLAB

Hi all,
I am working on a function H for generating a circle of radius R centered within an M-by-N digital image. The prompt suggests that I use imshow to visualize the image H for various values of R, M, and N. My issue is with generating the M-by-N digital image. I have been unable to find relevant documentation.
I am not familiar with the digital image processing capabilities of MATLAB and I am working on some exercises in anticipation for a digital image processing course. Any help would be greatly appreciated.

Best Answer

I = imread('peppers.png') ;
[nx,ny,nz] = size(I) ;
C = [round(ny/2) round(nx/2)] ; % center of circle
R = 100 ; % Radius of circle
th = linspace(0,2*pi) ;
xc = C(1)+R*cos(th) ;
yc = C(2)+R*sin(th) ;
imshow(I)
hold on
plot(xc,yc,'b')