Cellular automata in Matlab