Guest User

Untitled

a guest
Jan 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.19 KB | None | 0 0
  1. for i = 1:10
  2.     x = ceil(rand*4);
  3.  
  4.     if x == 1
  5.         pos(2) = pos(2) + 1;
  6.     else if x==2
  7.         pos(2) = pos(2) - 1;
  8.     else if x==3
  9.         pos(1) = pos(1) -1;
  10.     else
  11.         pos(1) = pos(1)+1;
  12.     end
  13. end
Add Comment
Please, Sign In to add comment