In: Computer Science
clc,clear,close all
%
% set limits on radii and centers
min_x = 10; max_x = 90; min_y = 10; max_y = 90;
min_radius = 2; max_radius = 10;
%
number_of_circles = 5;
colors = {'r','b','g','k','m'}; % five different colors
(number_of_circles)
%
% generate random centers and radii
x_center = (max_x-min_x).*rand(number_of_circles,1) + min_x;
y_center = (max_y-min_y).*rand(number_of_circles,1) + min_y;
radius = (max_radius-min_radius).*rand(number_of_circles,1) +
min_radius;
%
% define the angle 0 to 2*pi (complete revolution)
theta = linspace(0,2*pi,100);
%
% compute the coordinates x and y and plot
for i=1:numel(x_center)
x = radius(i) * cos(theta) + x_center(i);
y = radius(i) * sin(theta) + y_center(i);
%
plot(x,y,'color',colors{i})
hold on
end
xlim([1 100]),ylim([1 100]),grid
on,xlabel('x'),ylabel('y')
------------------------------------------------------------------------------
COMMENT DOWN FOR ANY QUERY RELATED TO THIS ANSWER,
IF YOU'RE SATISFIED, GIVE A THUMBS UP
~yc~