Réponse acceptée

Matt J
Matt J le 14 Mar 2021
Modifié(e) : Matt J le 14 Mar 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 commentaires

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange

Produits

Version

R2020b

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by