Borrar filtros
Borrar filtros

how to deploy sensor nodes randomly in a matrix 100x100

1 visualización (últimos 30 días)
Debalina Pal
Debalina Pal el 27 de Mzo. de 2018
Comentada: Walter Roberson el 18 de Mayo de 2018
how to deploy sensor nodes randomly in a matrix 100x100 ?

Respuesta aceptada

Jan
Jan el 27 de Mzo. de 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 comentarios
Jan
Jan el 18 de Mayo de 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 el 18 de Mayo de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by