| ²é¿´: 1276 | »Ø¸´: 3 | ||
| µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû | ||
chrislan625гæ (СÓÐÃûÆø)
|
[ÇóÖú]
Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд
|
|
|
ÀÏʦ½ÐÎÒÃÇ×Ôѧ ÉϿξÍҪд³öÒ»¸öÉúÃüÓÎÏ·µÄ´úÂë ¿´²»Ì«¶® ÒÔÏÂÊÇÀÏʦ¸øµÄÌáʾ Skeleton program function game_of_life( nx, ny, nstep ) %GAME_OF_LIFE Implements the Conway game of life % This function implements the Conway game of life in which beings are % generated and destroyed in a manner meant to represent evolution. They % are destroyed when they have too few or two many neighbours, and are % generated at a location with the right number of neighbours. % % Input parameters % nx The number of squares along the x-direction % ny The number of squares along the y-direction % nstep The number of iterations in the game % % Output parameters % None % % % Define some constants delay = 0.1; % The time between images in seconds dx = [-1, 0, 1, -1, 1, -1, 0, 1]; dy = [ 1, 1, 1, 0, 0, -1, -1, -1]; % % Initialise the grid world = zeros(nx+2, ny+2); % Extra sites around the edge fixed to zero [Add code here] % % Display the world imagesc(world); pause(delay); % % Step through all the moves for i = 1:nstep % % Count the number of neighbours for each site [Add code here] % % Update the world [Add code here] % % Display the world imagesc(world); pause(delay); end end |
» ²ÂÄãϲ»¶
¿¼Ñи´ÊÔµ÷¼Á£¬¹ý¹ú¼ÒÏßµÄͬѧ¶¼¿É±¨Ãû
ÒѾÓÐ5È˻ظ´
085600 Ó¢Ò»Êý¶þ272Çóµ÷¼Á
ÒѾÓÐ13È˻ظ´
Àíѧ£¬¹¤Ñ§£¬Å©Ñ§µ÷¼Á£¬ÉÙ×ßÍä·£¬ÕâÀï»¶ÓÄú£¡
ÒѾÓÐ5È˻ظ´
½ÓÊÕµ÷¼Á
ÒѾÓÐ7È˻ظ´
Ò»Ö¾Ô¸»ªÄÏÀí¹¤´óѧ²ÄÁÏÓ뻯¹¤326·Ö£¬Çóµ÷¼Á
ÒѾÓÐ3È˻ظ´
290Çóµ÷¼Á
ÒѾÓÐ5È˻ظ´
Ç廪´óѧ ²ÄÁÏÓ뻯¹¤ 353·ÖÇóµ÷¼Á
ÒѾÓÐ4È˻ظ´
²ÄÁÏ284Çóµ÷¼Á£¬Ò»Ö¾Ô¸Ö£ÖÝ´óѧӢһÊý¶þר˶
ÒѾÓÐ12È˻ظ´
»¯Ñ§£¬²ÄÁÏ£¬»·¾³ÀàÇóµ÷¼Á
ÒѾÓÐ3È˻ظ´
²ÄÁÏ»¯¹¤µ÷¼Á
ÒѾÓÐ14È˻ظ´
» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:
ÐÞ¸ÄÒ»¸öCÓïÑÔÉúÃüÓÎÏ·³ÌÐò
ÒѾÓÐ3È˻ظ´
chrislan625
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 54.5
- Ìû×Ó: 73
- ÔÚÏß: 7.4Сʱ
- ³æºÅ: 2005447
- ×¢²á: 2012-09-16
- רҵ: ½ðÊô½á¹¹²ÄÁÏ
4Â¥2013-11-15 09:24:29
chrislan625
гæ (СÓÐÃûÆø)
- Ó¦Öú: 0 (Ó×¶ùÔ°)
- ½ð±Ò: 54.5
- Ìû×Ó: 73
- ÔÚÏß: 7.4Сʱ
- ³æºÅ: 2005447
- ×¢²á: 2012-09-16
- רҵ: ½ðÊô½á¹¹²ÄÁÏ
|
1. Consider the following starting configuration: a world made of 5x5 squares, with 3 creatures in a horizontal line (XXX) at the centre. How many creatures are alive after 5 steps? 2. Consider the following starting configuration: a world made of 7x7 squares, with 5 creatures in a horizontal line (XXXXX) at the centre. How many creatures are alive after 5 steps? ÕâÊÇÕâ¸ö³ÌÐòÒª½â¾öµÄÎÊÌâ |
2Â¥2013-11-11 05:42:48
libralibra
ÖÁ×ðľ³æ (ÖøÃûдÊÖ)
æôÆï½«¾ü
- ³ÌÐòÇ¿Ìû: 40
- Ó¦Öú: 817 (²©ºó)
- ½ð±Ò: 12914.1
- ºì»¨: 64
- Ìû×Ó: 2238
- ÔÚÏß: 287.3Сʱ
- ³æºÅ: 696514
- ×¢²á: 2009-02-05
- רҵ: ¼ÆËã»úÈí¼þ

3Â¥2013-11-11 21:15:04













»Ø¸´´ËÂ¥
10