Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

can anyone help me get the code for the Cellular automata model which Implements and visualizes 1000 generations starting from a random initial states of 0 and 1. The size of the square universe should be user provided.

조회 수: 1 (최근 30일)
The rules to update the next generation is: 1. A cell will die in the next generation if 4 or more of its neighbours are dead at present time.
2. A cell will come back to life in the next generation if more than 4 of its neighbours are alive at present time.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 10월 26일
Assuming 8-connectivity:
Count the number of live neighbours. If it is 1, 2, or 3, then the cell will be dead next generation. If it is 5, 6, 7, or 8, then the cell will be alive next generation. If it is 4, then the cell switches between dead and alive.
Hint: conv2

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by