how to deploy sensor nodes randomly in a matrix 100x100

1 view (last 30 days)
how to deploy sensor nodes randomly in a matrix 100x100 ?

Accepted Answer

Jan
Jan on 27 Mar 2018
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 Comments
Jan
Jan on 18 May 2018
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 on 18 May 2018
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!