Inside a circle with random mesh points

 Accepted Answer

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 Comments

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

Sign in to comment.

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Products

Release

R2020b

Tags

Asked:

on 14 Mar 2021

Commented:

on 16 Mar 2021

Community Treasure Hunt

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

Start Hunting!