% mfile sfinit % inintialize sharks and fish disp(' Initializing shark and fish for simulation.') % 10 by 10 cell ocean d=30; % put fish and sharks in random places % (generate uniform [0,1] random numbers, and reset seed to 0) rand('uniform'); rand('seed',0) ofish = (rand(d,d) < .1); oshark = (rand(d,d) < .002) & (~ofish); rand('normal'); % Take 20 time steps n=60; disp(['Ocean size = ',num2str(d)]) disp(['Number of time steps = ',num2str(n)])