Plotting random points on a circle
Show older comments
I am trying to plot 50 random points on a circle with a radius of 500 then store the x, y coordinates of the points in a matrix and calculate each point's distance from the centre of the circle (0,0), any reference I could use or how I can achieve this?
Accepted Answer
More Answers (1)
David Hill
on 5 May 2020
a=2*pi*rand(1,50);
b=500*rand(1,50);
m=[b.*sin(a);b.*cos(a)];
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!