Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function Name: graveDigging MATLAB Inputs: 1. (cell) 1xN cell vector of zombie graves Outputs: 1. (double) The total strength of all zombies 2. (double) The

image text in transcribed

Function Name: graveDigging MATLAB Inputs: 1. (cell) 1xN cell vector of zombie graves Outputs: 1. (double) The total strength of all zombies 2. (double) The positions of immune bodies Background All of the graveyards have been infected with a Zombie Virus! Fortunately some of bodies are immune, but which ones? Luckily, the power of MATLAB can help you to assess a graveyard to determine the strength of the zombies and the location of the immune zombies. Function Description: You are given a 1xN cell array. Each element will be a nested cell of varying depths. Each position in the array will contain a scalar double which represents the strength of that zombie. Unnest the cells at each position, and output the sum of the all values of all the elements as the total strength. Then, find the element positions of all the zeros in the cell vector and return that as the second output. Example: >> graveyard = [{{{{4}}}}, {0}, {{1}}, {{{e}}}] [strength, immune] = graveDigging(graveyard) strength 5; immune [2, 41; Notes: Every cell will only contain either a 1x1 cell or a non-negative 1x1 double

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Organize and support your main points

Answered: 1 week ago

Question

Move smoothly from point to point

Answered: 1 week ago

Question

Outlining Your Speech?

Answered: 1 week ago