random points on a grid

조회 수: 9 (최근 30일)
Patrick Carey
Patrick Carey 2018년 10월 8일
댓글: Kevin Chng 2018년 10월 8일
Can someone say how to do this? What I am trying to do:
-Generate 200*200 grid
-populate the grid with 2 different agents
-The percentage of the grid that each different agent is populated with is set(e.g. if 10%, than there would be 20 of each different agent in the grid)
-Each cell of the grid can only be occupied by one thing.
I want to essentially generate a number of random 2D coordinates
  댓글 수: 1
Kevin Chng
Kevin Chng 2018년 10월 8일
coordinate = rand(200,200);
more information you may refer to Random Number
Sorry that i'm not very understand on some parts of your question, may be others may help you.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2018년 10월 8일
How about using rand ? Read about function rand.

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by