Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB. Do NOT use conditionals like if, else, statements. No loops also, like for loops. Function Name: loveSearch Inputs: 1. 2. (char) The word to
MATLAB.
Do NOT use conditionals like "if, else," statements. No loops also, like "for" loops.
Function Name: loveSearch Inputs: 1. 2. (char) The word to search for (char) An NxN square array representing the word search Outputs: 1. (char) The NxN array with the word "crossed out" Background: You've been searching for love for a while but haven't had any luck. Maybe you ha been searching in all the wrong places... so why not try searching in a word search? Ev better you can use MATLAB to help! Function Description Write a function in MATLAB that solves a word search puzzle. The function will take two inputs: the word to search for and a character array representing the word search. You v 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 'date', an example input puzzle and output are below dklr date gfnj cqrw input = dklr gfnj carw Notes: . You don't have to consider diagonals, but must consider the word horizontally forwar and backwards and vertically forward and backwards (the word can read up, down, le or right) The word may exist once or not at all If your solution recognizes words that span across several lines, i.e. recognizing 'valentine' in the puzzle below, that is okay. This edge case will not be tested for grading . . abcvale ntinelw Hints: . You may find the strrep) and reshape) functions useful . Think about how you can use transposing and linearizing to check for the word in the different directions
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