Drawing a circle with known radius

1 view (last 30 days)
Row Sarox
Row Sarox on 17 Apr 2022
Commented: Image Analyst on 17 Apr 2022
How can i create a circle shape including 100 circles with known radius. Labeled with 4 different colors.

Accepted Answer

KSSV
KSSV on 17 Apr 2022
Edited: KSSV on 17 Apr 2022
th = linspace(0,2*pi)' ;
R = 1;
x = R*cos(th) ;
y = R*sin(th) ;
% make groups
G = zeros(size(th)) ;
G(th >= 0 & th < pi/2) =1 ;
G(th>=pi/2 & th < pi) = 2 ;
G(th>=pi & th < 3*pi/2) = 3 ;
G(th >=3*pi/2 & th < 0) = 4 ;
gscatter(x,y,G,'bmgr','o')
axis equal
  2 Comments
Row Sarox
Row Sarox on 17 Apr 2022
Thanks, i have been struggling to change the colors.
Image Analyst
Image Analyst on 17 Apr 2022
There is also a function called viscircles() you might want to know about.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!