Plotting random points on a circle
显示 更早的评论
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?
采纳的回答
更多回答(1 个)
David Hill
2020-5-5
a=2*pi*rand(1,50);
b=500*rand(1,50);
m=[b.*sin(a);b.*cos(a)];
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!