Optimize code.

Without animation,
tic, galtonbox( 5, 1000, 0), toc
from 3.5s decreaced to 1.1s.