Question: MATLAB ONLY*** My code so far clear clc xcoords = [0 1 2 3 2 3 2 1 0]; ycoords= [2 1 1 2 2.5

MATLAB ONLY***

MATLAB ONLY*** My code so far clear clc xcoords = [0 1

My code so far

clear clc xcoords = [0 1 2 3 2 3 2 1 0]; ycoords= [2 1 1 2 2.5 3 4 4 3]; a=size(xcoords); b=size(ycoords), zcoords= ones(1,9); pacman=[xcoords;ycoords;zcoords]; fill(pacman,'yellow')

Questions 1-2: Create an image of the Pacman character. Start by entering the coordinates for the Pacman image shown below. You will not draw the points. These are just to help you create the vectors for the Pacmarn figure i. To enter the points for your Pacman figure, start with the green point, and proceed counterclockwise through the yellow points and stop at the red point. First, create a vector for the x-coordinates of each point. >xcoords Enter the x values here. ] Create this Pacman image! 4 ii. Now enter the y-coordinates for each point in the exact same order 2 >ycoords Enter the y values here. ] Note the y-value for the mouth is a half-integer iii. Later, we will need to use homogeneous to help translate the Pacman figure about a maze. Add the z-coordinates, all of which are 1. The number of 1's must be the same as the number of x's and y 's. Finish the assignment statement below. Use both the size and the ones command >zcoords... rdinate o -1 1 01 2 3 45 iv. Be sure to define: pacmanDxcoords; ycoords; zcoords]; You will need this variable to move the Pacman around the maze later Now paste in an image of your Pacman character. Use the fiLlOcommand to create your plot. Set the of red). Do not draw the points! Label both axes and add a title to the plot. LineWidth' to 4. You will not need the z-coordinates at this stage. Draw your Pacman using yellow (instead

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!