Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab code Function Name: lostWoods Inputs: 1. 2. 3. (char) The file name of an image of a maze (double) The row index of the
Matlab code Function Name: lostWoods Inputs: 1. 2. 3. (char) The file name of an image of a maze (double) The row index of the maze entrance (double) The column index of the maze entrance File Outputs 1. An image of the solved maze Background You stand at the entrance of a dark, deep forest You only see shadow ahead of you, but still you step in. The old stories say that somewhere deep in these woods lie riches and glory beyond your wildest imagination, and the allure of the treasure overcomes your fear. You take a few steps into the woods and are shrouded in darkness-you stop while you can still see the light of the entrance behind you. There must be a better way... Function Description: Write a function in MATLAB that takes in the name of an image file. This image is a map of the forest, and you are going to find the path to the treasure before you even step into the maze! The image can be of any size, but the rows and columns are divisible by 20- the maze is made of 20x20 solid colored squares. The walls of the maze are dark green, RGB(13,102,35) the paths of the maze are a lighter green, RGB(66,244,92), and the treasure is a gold colo RGB(255,223,0). The second and third inputs to the function are the indices of where the start square is on the edge of the maze. Your job is to solve the maze by drawing a path from the maze entrance to the treasure. To draw this path, change the color from the lighter green to gold (RGB(255,223,0)) at every square along the path. You will save this to a new image that has the original filename with 'solved' appended. Example If the image on the left is called maze.png, then running lostwoods( maze.png,1,7) should produce the image on the right, maze solved.png Continued
Matlab code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started