% Define the radii of the two circles
outer_radius = 5;
inner_radius = 2;
% Create a figure and draw the outer and inner circles
figure;
rectangle('Position', [-outer_radius, -outer_radius, 2*outer_radius, 2*outer_radius], ...
'Curvature', [1,1], 'FaceColor', 'none', 'EdgeColor', 'r', 'LineWidth', 2);
rectangle('Position', [-inner_radius, -inner_radius, 2*inner_radius, 2*inner_radius], ...
'Curvature', [1,1], 'FaceColor', 'none', 'EdgeColor', 'r', 'LineWidth', 2);
% Fill the space between the two circles with red color
rectangle('Position', [-outer_radius, -outer_radius, 2*outer_radius, 2*outer_radius], ...
'Curvature', [1,1], 'FaceColor', 'r', 'EdgeColor', 'none');
rectangle('Position', [-inner_radius, -inner_radius, 2*inner_radius, 2*inner_radius], ...
'Curvature', [1,1], 'FaceColor', 'none', 'EdgeColor', 'none');
You can customize the colors, radii and line widths as desired, and also adjust the position and size of the donut by changing the input arguments to the rectangle
function.