Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab Function Name: 3Marks The Spot 1. (chan An NxM character aray representing a map 2. (cha) A 1N character vector representing a series of

image text in transcribed
Matlab Function Name: 3Marks The Spot 1. (chan An NxM character aray representing a map 2. (cha) A 1N character vector representing a series of directions Outputs: 1. (cha) A string representing the result and the path you take You and your friends stumble upon an ancient treasure map one day and decide to embark on an adventure. Even though you tell them you'l meet up tomomow to look for t together, you grow suspicious that they are trying to claim the tre asure for themselves! As a CS 1371 student you decide to use your MATLAB skils to try to find it before your friends do Function Description: Write a function that navigates through a character aray map based on given directions Starting at the top left comer, move according to the following directions: Up Down Right Left After each direcion, make sure to record your current locaton tthe value of the character in the map), Keep going through the drections untl you reach the reasure, represented by an x.o reach the end of the directions lfyou encounter te"X. . your final outut should be in the form: I found the treasure by following the path along but couldn't find the treasure ap MAUQEHO directions'ESSWSESEEE treasure arksTheSpot (nap, directions) treasureI found the treasure by following the path along MAELX Notes: Te instructors wil, never gude you out oftn bounds ofthe map. and . . E. and W are the only directions (no diagonals). If you encounter the "x* in your path, you should stop there because there's no point in travelling further There is no guarantee that there is a treasure in the map. Only capital X' counts as a treasure, not x (lowercase) Letters can repeat and the path can intersect with itself There may be multiple treasures, but always stop at the first one

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

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago