Guest User

Untitled

a guest
Dec 15th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. r = rand(100)
  2. a_hat = ones(100);
  3. a_hat[find(r <= p_2)] = 2
  4. a_hat[find(r > p_2 && r <= p_3)] = 3
  5.  
  6. votes = zeros(3)
  7. for n=1:100
  8. votes[a_hat[n]] += 1
  9. end
  10. action = indmax(votes)
Add Comment
Please, Sign In to add comment