(Matlab starting script)problem3 disp(problem3);.docx - (Matlab starting script%problem3 disp*problem3%initialize grid configurations for 3 common cases

(Matlab starting script)problem3 disp(problem3);.docx -...

• No School
• AA 1
• 6

This preview shows page 1 - 4 out of 6 pages.

Subscribe to view the full document.

(Matlab starting script) %problem3 disp('*****problem3*****'); %initialize grid configurations for 3 common cases tubMatrix = [zeros(1,5); 0 0 1 0 0 ; 0 1 0 1 0; 0 0 1 0 0; zeros(1,5)]; blinkerMatrix = [zeros(1,5); 0 0 1 0 0 ; 0 0 1 0 0; 0 0 1 0 0; zeros(1,5)]; shipMatrix = [zeros(1,10); 0 0 1 0 0 0 0 0 0 0; 0 0 0 1 0 0 0 0 0 0; 0 1 1 1 zeros(1,6); zeros(6,10)]; for pattern = 1:3 %repeat for each of the 3 patterns figure() %initialize the grid matrix depending on what type of pattern is selected �� �� %************************************************* ************************************ %YOU MUST EDIT THIS PART �� %Use a switch statement to choose one of these 3 patterns based on the value %of the variable 'pattern' %static pattern - Tub gridMatrix = tubMatrix;
�� %oscillating pattern - Blinker (initially vertical) gridMatrix = blinkerMatrix; �� %spaceship pattern - Glider gridMatrix = shipMatrix; �� %SWITCH STATEMENT ENDS HERE %************************************************* *********************************** �� %Don't edit these two lines dispMatrix = imresize(gridMatrix,[100, 100], 'nearest'); imshow(dispMatrix) �� �� %************************************************* ************* % YOU MUST EDIT THIS PART %Use a while loop to keep executing this block of code until one of the following two

Subscribe to view the full document.

• Fall '19
• Control flow, loop, Conway's Game of Life

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes