MAT 343 LAB 4 Problem 4 My Solutions > Adapt the procedure developed in Exercise 3, to ▪ Rescale the axis by using axis ([-7,7,-7,7]) ▪ Enter the rotation matrix that rotates counterclockwise by increments of π/6 about the origin and store it in the variable Q ▪ Enter the dilation matrix that dilates by a factor of 7/6 and store it in the variable D1. ▪ Use Q, D1 and a for loop to rotate the square about the origin by increments of π/6 for a total angle of 2, and expanding at the same time by a factor of 7/6. ▪ Enter the contraction matrix that contracts by a factor of 6/7 and store it in D2. ▪ Enter the rotation matrix that rotates the square clockwise by increments of /6 about the origin and store it in the variable Q2. ▪ Use Q2, D2 and a for loop to rotate the square clockwise by increments of /6 for a total angle of 2 and contracting it until it shrinks to its original size and original location. For your convenience the main part of the code, taken from Example 6, is included in the script box. Fill in the missing parts. Don't forget to include your name in the script. NOTES: 1. When you Run the script, the animation will not show. To check that your animation is correct, it is recommended you create an M-file with the script and run it in MATLAB. 2. Don't forget to include your name in the script. 3. There is no partial credit on this problem. 1% YOUR NAME 2 S= [0,1,1,0,0,0,0,1,1,0]; 3 p = plot (S(1,:), 5(2,:)); 4 % resize the axis 6 axis square 7 grid on 8 hold on 9% Enter the rotation matrix Q 10 11 % Enter the dilation matrix D1 12 D1= 13 for i = % index for the first loop 14 S = % apply c/clockwise rotation + dilation to the matrix S 15 set(p, 'xdata',S(1,:), 'ydata',5 (2, :)); 16 pause (0.1) 17 end 18 % enter the clockwise rotation matrix and the contraction matrix 19 Q2= 20 D2= 21 for i- % index for the second loop 22 S = %apply clockwise rotation + contraction 23 set(p, 'xdata',S(1,:), 'ydata',S(2,:)); 24 pause (0.1) 25 end 26 hold off 27 ►