Filter löschen
Filter löschen

how to deploy sensor nodes randomly in a matrix 100x100

1 Ansicht (letzte 30 Tage)
Debalina Pal
Debalina Pal am 27 Mär. 2018
Kommentiert: Walter Roberson am 18 Mai 2018
how to deploy sensor nodes randomly in a matrix 100x100 ?

Akzeptierte Antwort

Jan
Jan am 27 Mär. 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 Kommentare
Jan
Jan am 18 Mai 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 am 18 Mai 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by