make square image with a circle in the middle, amataure code in matlab
main.m
% Create a black square imageimage_size = 500;
square_image = zeros(image_size, image_size);
% Find the center of the imagecenter_x = image_size / 2;
center_y = image_size / 2;
% Create a meshgrid to represent the coordinates of the image[X, Y] = meshgrid(1:image_size, 1:image_size);
% Define the radius of the circleradius = image_size / 4;
% Create a binary mask for the circle using distance from centercircle_mask = (X - center_x).^2 + (Y - center_y).^2 <= radius.^2;
% Assign white color (255) to the circle region in the square imagesquare_image(circle_mask) = 255;
% Display the square image with circleimshow(square_image);