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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!