Generating a cylindrical cluster

1 回表示 (過去 30 日間)
Girvani Manoharan
Girvani Manoharan 2019 年 3 月 21 日
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 Center および File ExchangeClusters and Clouds についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by