Concatenate matrix matlab

broken image
broken image

Concatenate the first half (12 points), with the whole of the maze shifted by (60,20) and then concatenate the last half another 12 points) to close up the four loops. Your maze has already doubled and now has 24 points. You will need to make two changes to the above code. Concatenating Objects of Different Classes.

broken image

Now double the loop again to get FOUR loops. Even a single number is stored as a matrix. The elements can be numbers, logical values (true or false), dates and times, strings, categorical values, or some other MATLAB data type. A matrix is a two-dimensional, rectangular array of data elements arranged in rows and columns. Assuming you have entered the first loop in the previous question, you can get both loops all at once using: % Insert second Loop for the PACMAN maze x maze = ( x maze(1:6) x maze+30 x maze (7:12)] Y_maze = b. The most basic MATLAB® data structure is the matrix. The second loop is a copy of the first loop but translated by 35 units in the x-direction and 10 units in the y-direction. We will need to insert the new loop between the first six and the last six points.

broken image

Notice the first six points traverse your loop in the counter- clockwise direction, while the last six traverse the loop clockwise, and complete it. Question 7: The Pacman Maze with Four Loops a. %initial loop for maze X_maze = y_maze = y_maze = ( y_maze (1:6) y_maze+10 y_maze (7:12)] %fill(x_maze, y_maze, 'cyan') %double first 2 loops

broken image