2D random walk sequence
    5 ビュー (過去 30 日間)
  
       古いコメントを表示
    
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.
0 件のコメント
回答 (1 件)
  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')
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Random Number Generation についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

