Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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***

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions

Question

5. How can I help others in the network achieve their goals?

Answered: 1 week ago

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago