Hi Suvin pv, It will help a lot to give a brief explanation on the specific type of traffic flow problem you are investigating using automata. You may find this link useful http://natureofcode.com/book/chapter-7-cellular-automata/.
But if you are still insisting on MATLAB then: http://www.mathworks.com/matlabcentral/fileexchange/34956-nagel-schreckenberg-model-implementation?focused=3861399&tab=function