채택된 답변

Matt J
Matt J 2021년 3월 14일
편집: Matt J 2021년 3월 14일

1 개 추천

One way,
N=3e3; %number of points
R=3; %radius
r=R*rand(N,1);
theta=2*pi*rand(N,1);
X=r.*cos(theta); Y=r.*sin(theta);
scatter(X,Y); axis equal

댓글 수: 2

And if you want the distribution to be uniform across the area:
r=R*sqrt(rand(N,1));
SAILESH R
SAILESH R 2021년 3월 16일
Thank You very much Sirs.. Was Really helpful to me. Kudos....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 3월 14일

댓글:

2021년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by