Question: Write a function in MATLAB that solves a word search puzzle. The function will take in two inputs: the word to search for and a
Write a function in MATLAB that solves a word search puzzle. The function will take in two inputs: the word to search for and a character array representing the word search. You will find the occurrence of the word in the puzzle and cross it out by replacing the letters with #. You will then return this updated array.
Example: If the word to search for is ' owl ', an example input puzzle and output are below. input = abc abc owl -> ### xyz xyz
Notes: You dont have to consider diagonals, but must consider the word horizontally forwards and backwards and vertically forward and backwards (the word can read up, down, left, or right) The word may or may not exist in the search; if there is an occurrence there will only be one If your solution recognizes words that spans across several lines, i.e. recognizing ' wizard ' in the puzzle below, that is okay. This edge case will not be tested for grading. abcwiz arddef Hints: You may find the strfind() and reshape() functions useful.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
