Question: Set up your code so it has the following input parameters: p = 0 . 4 ( probability ) n = 2 0 ( matrix

Set up your code so it has the following input parameters:
p =0.4(probability)
n =20(matrix size)
maxt =10(number of iterations)
and evolves the wildfire using these input parameters for maxt iterations. Make sure the code is annotated.
Ideally, the code should print an mp4 movie of the evolving matrix.
To to this in Matlab, use the following command:
% Open the video file
vidfile = VideoWriter('testmovie.mp4','MPEG-4');
open(vidfile);
for k=1:maxt. %Looping over all timesteps
imagesc(Mmov(:,:,k)).% this creates an image of the step k matrix
F(k)= getframe(gcf); % this records the image
writeVideo(vidfile,F(k)); % this appends it to the video
end
close(vidfile) matlab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!