Drawing a circle with known radius

8 次查看(过去 30 天)
How can i create a circle shape including 100 circles with known radius. Labeled with 4 different colors.

采纳的回答

KSSV
KSSV 2022-4-17
编辑:KSSV 2022-4-17
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 个评论
Row Sarox
Row Sarox 2022-4-17
Thanks, i have been struggling to change the colors.
Image Analyst
Image Analyst 2022-4-17
There is also a function called viscircles() you might want to know about.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by