elegant algorithm

Nov 07, 2007 13:51

spacing = ( ( length / nveh ) / cell );
for i = 1:spacing:numcells
here = round(i);
roadway(here) = 1;
speeds(here) = floor(min(4,length/cell/nveh));
end
Previous post Next post
Up