tell me the code for how to place scatterrers in a cylindrical volume?
1 回表示 (過去 30 日間)
古いコメントを表示
vinod kumar govindu
2016 年 10 月 18 日
コメント済み: Walter Roberson
2016 年 10 月 19 日
place different scatterrers in a cylindrical volume
7 件のコメント
Walter Roberson
2016 年 10 月 18 日
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))
採用された回答
Walter Roberson
2016 年 10 月 18 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Timetables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!