2D random walk sequence

조회 수: 1 (최근 30일)
amrutha Priya
amrutha Priya 2013년 1월 12일
starting at (0,0) sample a random number x1 and x2 that is evenly distributed in the interval (0,1]. step size is s=100ln(x1) and angle alpha=2*pi*x2. move the point by step s and angle alpha.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 12일
편집: Azzi Abdelmalek 2013년 1월 12일
x1=rand(1,10)
x2=rand(1,10)
s=100*log(x1)
alpha=2*pi*x2
c1=s.*exp(j*alpha)
c1_x=cumsum(real(c1))
c1_y=cumsum(imag(c1))
plot(c1_x,c1_y,'->r')

카테고리

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