SHARE
TWEET

Untitled

a guest Sep 15th, 2014 312 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %   1  2  3  4  5
  2. %   6  7  8  9 10
  3. %  11 12 13 14 15
  4. %  16 17 18 19 20
  5. %  21 22 23 24 25
  6. % Setup of the matrix:
  7. corner = ...
  8. [.6 .2 0 0 0;
  9. .2 .4 .2 0 0;
  10. 0 .2 .4 .2 0;
  11. 0 0 .2 .4 .2;
  12. 0 0 0 .2 .6];
  13. side = diag([.2 .2 .2 .2 .2]);
  14. mid = ...
  15. [.4 .2 0 0 0;
  16. .2 .2 .2 0 0;
  17. 0 .2 .2 .2 0;
  18. 0 0 .2 .2 .2;
  19. 0 0 0 .2 .4];
  20. z = zeros(5);
  21. A = [
  22. corner,side,z,z,z;
  23. side,mid,side,z,z;
  24. z,side,mid,side,z;
  25. z,z,side,mid,side;
  26. z,z,z,side,corner];
  27.  
  28. %setup start distribution:
  29. startpos = [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0]';
  30.  
  31.  
  32. result = NaN(5);
  33. result(:) = A^15 * startpos;
  34. bar3(result)
  35. axis([-.5,5.5,-.5,5.5,0.038,0.042]);
  36. result(13)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top