random points on a grid

8 ビュー (過去 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 Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by