how to deploy sensor nodes randomly in a matrix 100x100

1 次查看(过去 30 天)
how to deploy sensor nodes randomly in a matrix 100x100 ?

采纳的回答

Jan
Jan 2018-3-27
M = zeros(100, 100);
Index = randperm(100*100, 100); % Linear index
M(Index) = 1;
Now you have 100 ones in a zero matrix. If "deploy nodes in a matrix" means something else, please be so kind and explain the details.
  52 个评论
Jan
Jan 2018-5-18
Please stop this discussion here. The original question to distribute elements in a matrix has been solved already. Attaching 47 further comments about a different topic is not useful. Debalina Pal, please open a new thread.
Walter Roberson
Walter Roberson 2018-5-18
I do not have code for that purpose. I would have to find code for it, which is something that you can do on your own.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by