Advertisement
elcocodrilotito

simplerandomwalk

Mar 1st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.24 KB | None | 0 0
  1. n=50
  2. p=@(m) factorial(n)/((2^n)*factorial((n+m)/2)*factorial((n-m)/2))
  3. b=@(m) sqrt(2/(pi*n))*exp(-(m^2)/(2*n))
  4. x=[10:2:40];
  5. y=[];
  6. z=[]
  7. for i=10:2:40;
  8.     a=p(i);
  9.     y=[y a]
  10.     z=[z b(i)]
  11. end
  12.  
  13. plot(x,y)
  14. hold on
  15.  
  16. plot(x,z)
  17. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement