Question: Matlab code Function Name: deepestPath Inputs: 1. (cell) A 1xN nested cell array Outputs 1. (char) A character vector describing the deepest path in the

Matlab code  Matlab code Function Name: deepestPath Inputs: 1. (cell) A 1xN nested

Function Name: deepestPath Inputs: 1. (cell) A 1xN nested cell array Outputs 1. (char) A character vector describing the deepest path in the woods. Background Recursion just shook your entire world and sense of well being. You no longer can tell left from right, or a double from a char. To get a grip on reality, you decide to take a long, introspective walk into the depths of a nearby forest. You have several different path options and you are trying to decide which one will give you the longest path before you reach a dead end. You quickly realize the complexity of the situation, and you are about to give up when you find a map! Alas, a solution! The map you found is a map of nested cell arrays, and you immediately know what to do. Function Description: Write a recursive function that will search through a nested cell array to find the maximum depth of nested cells. Then output the string 'The deepest path is ca(1, (true,(4,( trees, ((f8, ' >description- deepestPath(ca) description The deepest path is 4 cells deep. Notes: . It does not matter what is found inside of the nested cell. You are only concerned with the depth. Hints: . What should the depth be when the input is not a cell/cell array? . You will need a wrapper function to format the output string. . Consider how you can call the recursive function on every element in the cell array

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 Databases Questions!