Akzeptierte Antwort

Matt J
Matt J am 14 Mär. 2021
Bearbeitet: Matt J am 14 Mär. 2021
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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Tags

Gefragt:

am 14 Mär. 2021

Kommentiert:

am 16 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by