元胞自动机-沙堆模型代码.pdfVIP

  • 54
  • 0
  • 约3.5千字
  • 约 2页
  • 2020-06-22 发布于河北
  • 举报
function [] testCA (n) z zeros(n,n); cells z; cells(n/2,.25*n:.75*n) 1; cells(.25*n:.75*n,n/2) 1; imh image (cat (3,cells,z,z)); set (imh, erasemode, none) axis equal axis tight %Ö÷º¯Êý²ÎÊý nx 52; %must be divisible by 4 ny 100; Pbridge .05; z zeros(nx,ny); o ones(nx,ny); sand z; sandNew z; gnd z ; gnd (1:nx,ny-3) 1 ;% the ground line gnd (nx/4:nx/2+4,ny-15) 1; %the hole line gnd (nx/2+6:nx,ny-15) 1; %the hole line gnd (nx/4, ny-15:ny) 1; %side line gnd (3*nx/4, 1:ny) 1 ; %Ö÷º¯Êý for i 1:1000 p mod (i,2); %margolis neighborhood sa

文档评论(0)

1亿VIP精品文档

相关文档