pagheca
Mechanical
- Nov 27, 2005
- 31
Hi everyone,
I would like to simulate as a start the throw of two dices and want to check how many times I get a certain value from 0 to 12.
I used a while loop (see attachment) but it doesn't work as it never exit the loop. N is the number of throws to try. Y[0,P is a vector, j is an index. Z is the histogram that should contain the result (but actually I guess there is a problem also here as it looks I never compute any of the instruction from D <- to j+1).
Where am I wrong? Must be very easy but I didn't get probably the logic of these loop programming. Thanks for any help,
pagheca
I would like to simulate as a start the throw of two dices and want to check how many times I get a certain value from 0 to 12.
I used a while loop (see attachment) but it doesn't work as it never exit the loop. N is the number of throws to try. Y[0,P is a vector, j is an index. Z is the histogram that should contain the result (but actually I guess there is a problem also here as it looks I never compute any of the instruction from D <- to j+1).
Where am I wrong? Must be very easy but I didn't get probably the logic of these loop programming. Thanks for any help,
pagheca