フィルターのクリア

How to give number to the node randomly

2 ビュー (過去 30 日間)
Sushree Patra
Sushree Patra 2018 年 12 月 8 日
コメント済み: Sushree Patra 2018 年 12 月 9 日
I placed 50 random node in the area of 180*40.
Now how to give number to that random node from 1-50 and also how to calculate the coordinates of each random node.
  4 件のコメント
Jan
Jan 2018 年 12 月 9 日
I do not understand the question. What does "give number" mean? If you have placed the "nodes" (what ever this means) already, you do have the corrdinates. So what do you want to calculate?
Sushree Patra
Sushree Patra 2018 年 12 月 9 日
Thank you sir jan for the response.
well, actually the thing is in a plot I placed 50 points randomly. Now i have to provide 1-50 number each random point.
Problem is - In a area or 301*160 I placed 13 points according to thr coordinates and 50 random points randomly now i have to number each point to find out wich points are closer to selected coordinates point.

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

採用された回答

Image Analyst
Image Analyst 2018 年 12 月 9 日
Since each point is a random number, there is no need to shuffle/randomize their indexes in the x and y array afterwards. If you think there is for some reason, then tell us the reason why x and y will need to be randomly shuffled with randperm:
x = x(randperm(length(x)));
y = y(randperm(length(y)));
It's not clear why you need to do this.
  7 件のコメント
Image Analyst
Image Analyst 2018 年 12 月 9 日
I don't know what relay nodes and sink nodes are. Sorry, but I don't have time to delve into your project and co-develop it with you. I hope by seeing how I computed distances, and found nearby ones and the closest ones, you can adapt it as needed. It really shouldn't be that hard. Good luck.
Sushree Patra
Sushree Patra 2018 年 12 月 9 日
Thank you for your Solutions and response. I ll try by my self.
relay node: which helps to forword the data.
sink node: one output device.
Thank you

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by