tell me the code for how to place scatterrers in a cylindrical volume?
1 view (last 30 days)
Show older comments
vinod kumar govindu
on 18 Oct 2016
Commented: Walter Roberson
on 19 Oct 2016
place different scatterrers in a cylindrical volume
7 Comments
Walter Roberson
on 18 Oct 2016
Then my code below is a solution. You do not need to plot the X Y Z points if you do not want to. Adjust the radius and height parameters according to your needs. N is the number of points to generate. The K'th scatterrer is located at (X(K), Y(K), Z(K))
Accepted Answer
Walter Roberson
on 18 Oct 2016
radius = 5;
height = 18;
N = 1000;
r = sqrt(rand(1,N)) * radius;
th = rand(1,N) * 2 * pi;
h = rand(1,N) * height;
[X, Y, Z] = pol2cart(th, r, h);
scatter3(X, Y, Z)
3 Comments
More Answers (0)
See Also
Categories
Find more on Timetables 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!