필터 지우기
필터 지우기

how to deploy sensor nodes randomly in a matrix 100x100

조회 수: 1 (최근 30일)
Debalina Pal
Debalina Pal 2018년 3월 27일
댓글: Walter Roberson 2018년 5월 18일
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