資源簡介
用matlab編寫的,基于元胞自動機思想的交通流模型。
代碼片段和文件信息
function?traffic1(n)?
%???????n是進站前的公路的格數
%????Example:???traffic(100);?
if?nargin==0;?n=100;?end?
B=round(5*rand(9n+2));?B([13579]:)=1.2;
bb=B([2468]:);bb(bb~=0)=1;B([2468]:)=bb;
Z=B;H=imshow(Z[]);?
set(gcf‘position‘[241?132?560?420])?;set(gcf‘doublebuffer‘‘on‘);?
xlabel(‘Please?press?“space“?key?and?stop?this?program!‘...?
?‘fontsize‘12‘color‘‘r‘);??????????k=1;?
title(‘cel
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????841??2007-07-01?15:54??traffic1.m
-----------?---------??----------?-----??----
??????????????????841????????????????????1
評論
共有 條評論