Generating a cylindrical cluster
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Clusters and Clouds 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!