Game of Life - Not able to collect data for each simulation
Show older comments
Hello there,
I am creating a Game of Life through Matlab (something that I am not familiar with). I have made several simulations of game of life and I need to collect data from each simulation through function of time and then plot it. This is a sample of what I did:
A = sparse(round(rand(n,m)));
B = sparse(size(A));
A = B;
subplot(2,4,1);
imagesc(A); pause(0.01);
yA = nnz(A);
subplot(2,4,5);
hold on
plot(t,yA,'r.-');
hold off
xlim([0 tmax]);
ylim auto;
pause(0.01);
But I am not able to collect any values and with this code I can plot but the points wont connect since I am planting single numbers onto the plot.
Help please and thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Conway's Game of Life in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!