Generating a cylindrical cluster

1 次查看(过去 30 天)
I have created a 3D cluster and assigned values to represent a sandstone as attaced (3dlattice). Now, I want to create a cylinder to resemble a core and randomly assign two particular values across the cylinder. I am working with the below code but couldn't achieve my goal. I would appreciate, if you could guide me on the correct path?
n=10000; % number of points that you want
center = [20 ,20]; % center coordinates of the circle [x0,y0]
radius = 12.5; % radius of the circle
angle = 2*pi*rand(n,1);
r = radius*sqrt(rand(n,1));
X = round(r.*cos(angle)+ center(1));
Y = round(r.*sin(angle)+ center(2));
Z=round(60*sqrt(rand(n,1)));
scatter3(X,Y,Z);
Thank you.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Clusters and Clouds 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by