I want to generate random point with Six closest nebulous in cuboid with dimension 100 m

1 回表示 (過去 30 日間)
I want to generate random nodes with Six closest nebhours in cuboid with dimension 100 m
  2 件のコメント
KSSV
KSSV 2019 年 5 月 16 日
YOu mean six random points inside a cubiod?
Sujeet Kumar Rai
Sujeet Kumar Rai 2019 年 5 月 16 日
Dear sir First of all I want to clear the question
I want to generate 100 random point with each point aware of 6 closest nebhours in cuboid of dimension 100 m.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2019 年 5 月 16 日
% Random point
O = rand(1,3) ;
% Six random points with in cubiod of 100 m
L = 100 ;
n = 6 ;
P = zeros(n,3) ;
for i = 1:3
a = O(i)-L/2 ;
b = O(i)+L/2 ;
P(:,i) = (b-a).*rand(n,1) + a;
end
figure
hold on
plot3(O(1),O(2),O(3),'*r')
plot3(P(:,1),P(:,2),P(:,3),'.b')
  2 件のコメント
KSSV
KSSV 2019 年 5 月 16 日
Sujeet Kumar Rai commented:
Dear sir thanku very much for yor prompt response
I want to generate 100 random point with each point aware of 6 closest nebhours in cuboid of dimension 100 m.
Regarding above problem
is there any to find centerod of random point in cuboid, and also find the closest distance from centeroid to nebhours in given cuboid?
KSSV
KSSV 2019 年 5 月 16 日
To find centroid use mean. To find the closes distance, read about knnsearch.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProbability Distributions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by