how to distribute users uniformaly inside rectangle

I have a rectangle in xy plane eg. R=50 , how can I distribute users inside the rectangle in a uniform distribution and after that how can I find the xy coordination of each user inside the rectangle. thanks

댓글 수: 2

KSSV
KSSV 2017년 5월 19일
What are users? A string? A number ? random or uniform? Be clear with the question.
Ahmad Hani
Ahmad Hani 2017년 5월 19일
편집: Ahmad Hani 2017년 5월 19일
Users points in xy plane every user has its random coordination (x,y) inside the rectangle Uniformly distributed random

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

 채택된 답변

KSSV
KSSV 2017년 5월 19일
L = 1 ; % length of the rectnagle
B = 2 ; % breadth of the rectangle
Rect = [ 0 0 ; L 0 ; L B ; 0 B ; 0 0] ;
N = 1000 ;
a1 = 0;
b1 = L;
x = (b1-a1).*rand(N,1) + a1;
a2 = 0;
b2 = B;
y = (b2-a2).*rand(N,1) + a2;
plot(Rect(:,1),Rect(:,2),'r')
hold on
plot(x,y,'.b')

댓글 수: 1

How can I generate random non uniformly distributed user locations in the same rectangle???

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

질문:

2017년 5월 18일

댓글:

2017년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by