Question
cell arrays and strings in MATLAB! 1.Create a function in MATLAB called whereisWaldo that receives a cell array. Each cell will contain a string or
cell arrays and strings in MATLAB!
1.Create a function in MATLAB called whereisWaldo that receives a cell array.
Each cell will contain a string or a char array.The function will return the index of cells in which the string or char array was "Waldo"(or "Waldo").
* If there is no "Waldo" return an empty array.
*If there is more than one "Waldo" return all the indices.
*A string or char array that contains "Waldo" as a substring does not count.For example,we will not want to get the index of a acell whith the string "Waldo is here".
* Hint: use cellstr or string.
2.Test your function.In the script create cell arrays with the following situations and check that your function resturns what you expect.
*There is no Waldo.
*Two Waldos
*Waldo is a string
*Waldo is a char array
*Waldo is a substring(check that you do not get that index)
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