Znn3bq.jpeg
²é¿´: 1305  |  »Ø¸´: 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
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

chrislan625

гæ (СÓÐÃûÆø)

ÒýÓûØÌû:
3Â¥: Originally posted by libralibra at 2013-11-11 21:15:04
²»Í¬ÉúÃüÓÎÏ·µÄ¹æÔò¿ÉÒÔ²»Í¬,Ò»°ã¶¼ÊÇÁÚÓòСÓÚ2»òÕß´óÓÚ3,»îcell»áËÀµô.ÁÚÓòµÈÓÚ3,ËÀcell¿ÉÒԳɻî.Èç¹ûÊÇÕâ¸ö¹æÔò,5*5run5´ÎºÍ7*7run5´ÎµÄ½á¹ûÈçÏÂͼ.×Ô¼ºÊýһϾÍÐÐ.

5*5run5´Î


7*7run5´Î
...

´óÉñÇó½Ì~ ÎÒÃÇÒ»µã»ù´¡ÖªÊ¶¶¼Ã»½Ì¹ý°¡
4Â¥2013-11-15 09:24:29
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 4 ¸ö»Ø´ð

chrislan625

гæ (СÓÐÃûÆø)

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
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

libralibra

ÖÁ×ðľ³æ (ÖøÃûдÊÖ)

æôÆï½«¾ü

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
xzhdty: лл²ÎÓë 2013-11-12 10:27:22
²»Í¬ÉúÃüÓÎÏ·µÄ¹æÔò¿ÉÒÔ²»Í¬,Ò»°ã¶¼ÊÇÁÚÓòСÓÚ2»òÕß´óÓÚ3,»îcell»áËÀµô.ÁÚÓòµÈÓÚ3,ËÀcell¿ÉÒԳɻî.Èç¹ûÊÇÕâ¸ö¹æÔò,5*5run5´ÎºÍ7*7run5´ÎµÄ½á¹ûÈçÏÂͼ.×Ô¼ºÊýһϾÍÐÐ.

5*5run5´Î
Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд

7*7run5´Î
Çó´óÉñ½ÌMATLAB ÉúÃüÓÎÏ·´úÂëÔõôд-1
matlab/VB/python/c++/Javaд³ÌÐòÇë·¢QQÓʼþ:790404545@qq.com
3Â¥2013-11-11 21:15:04
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] µç×ÓÐÅÏ¢270Çóµ÷¼Á +15 terminal469 2026-04-07 15/750 2026-04-12 09:44 by ÄæË®³Ë·ç
[¿¼ÑÐ] 305Çóµ÷¼Á +7 Â꿨°Í¿¨boom 2026-04-11 7/350 2026-04-12 07:35 by zhouxiaoyu
[¿¼ÑÐ] 296Çóµ÷¼Á +8 Íô£¡£¿£¡ 2026-04-09 8/400 2026-04-11 21:02 by ÄæË®³Ë·ç
[¿¼ÑÐ] 070300»¯Ñ§279Çóµ÷¼Á +19 ¹þ¹þ¹þ^_^ 2026-04-08 20/1000 2026-04-11 20:43 by stoner78
[¿¼ÑÐ] 352 Çóµ÷¼Á +6 yzion 2026-04-11 8/400 2026-04-11 16:24 by Ã÷Ô´ËʱÓÐ
[¿¼ÑÐ] µ÷¼Á +5 ÎĵÀÐÇ̨ 2026-04-11 5/250 2026-04-11 15:01 by ¿­¿­Òª±ä˧
[¿¼ÑÐ] 285Çóµ÷¼Á +8 ¶ñ·¨´ó¶þµÄÆøÎ¶ß 2026-04-05 11/550 2026-04-11 11:28 by ×ÏêØ×ÏÆå
[¿¼ÑÐ] 22408 352·ÖÇóµ÷¼Á +4 ŬÁ¦µÄÏÄÄ© 2026-04-09 4/200 2026-04-11 10:42 by maddjdld
[¿¼ÑÐ] 288Çóµ÷¼Á +15 ´úfish 2026-04-09 16/800 2026-04-11 10:26 by wwj2530616
[¿¼ÑÐ] »úеר˶270Çóµ÷¼Á£¬½ÓÊÜ¿çרҵ +12 ÀÏʦ¿´¿´ÎÒ°Éaba 2026-04-09 14/700 2026-04-11 10:21 by laoshidan
[¿¼ÑÐ] Çóµ÷¼Á +5 ²»»á·ÉµÄÓã@ 2026-04-10 5/250 2026-04-10 19:07 by chemisry
[¿¼ÑÐ] 085800 ÄÜÔ´¶¯Á¦Çóµ÷¼Á +6 °¢biu°¡°¡°¡°¡°¡ 2026-04-10 6/300 2026-04-10 15:03 by hemengdong
[¿¼ÑÐ] »·¾³×¨Ë¶µ÷¼Á +16 »á˵»°µÄÖâ×Ó 2026-04-06 16/800 2026-04-10 10:30 by asy1wn
[¿¼ÑÐ] 283µç×ÓÐÅÏ¢Çóµ÷¼Á +4 ÈýʯWL 2026-04-08 4/200 2026-04-09 10:21 by wp06
[¿¼ÑÐ] 0860004 Çóµ÷¼Á 309·Ö +6 Yin DY 2026-04-09 6/300 2026-04-09 10:19 by °¡Àî999
[¿¼ÑÐ] 270Çóµ÷¼Á +3 031127 2026-04-06 4/200 2026-04-08 21:00 by ÄæË®³Ë·ç
[¿¼ÑÐ] ²ÄÁÏ¿ÆÑ§Ó빤³Ì320Çóµ÷¼Á£¬080500 +12 »Æ¹ÏζÊíÆ¬ 2026-04-06 12/600 2026-04-08 16:26 by luoyongfeng
[¿¼ÑÐ] 0703µ÷¼Á£¬Ò»Ö¾Ô¸Ìì½ò´óѧ319·Ö +23 haaaabcd 2026-04-05 26/1300 2026-04-08 16:19 by luoyongfeng
[¿¼ÑÐ] 304Çóµ÷¼Á +10 ËØÄê¼ÀÓï 2026-04-06 17/850 2026-04-08 09:05 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 322Çóµ÷¼Á +3 àźߺߺã 2026-04-05 3/150 2026-04-05 19:52 by nepu_uu
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û