MATLAB: How to deploy sensor nodes randomly in a matrix 100×100

deployment of sensor nodes

how to deploy sensor nodes randomly in a matrix 100×100 ?

Best Answer

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.