Answered step by step
Verified Expert Solution
Question
1 Approved Answer
matlab Inputs: 1. (struct) An 1xN structure array 2 (char) A fieid name Outputs: (struct) An 1xM updaled strucbure array char) A descriptive statement about
matlab
Inputs: 1. (struct) An 1xN structure array 2 (char) A fieid name Outputs: (struct) An 1xM updaled strucbure array char) A descriptive statement about the dan battle 2 everyone's favorite childhood book serkes about dans of feral cats Rather than simply While reading anoce you realize that the plot is qute dmcult to keep up with at times. exciting adventures of the protagonist, Firepaw of he ThunderClan, ike a casual crodible reader, you decide to go the extra step Since you are such a dedicated fan of this in senes, you will write a MATLAB function to track the battles of the dans th Function Description: that takes in an 1xN structure anay and a feld name of a statistic thnat is the most important in a particular battle. Each structure in the array represents a diferent clan of cats. Based on the values quaranteed to be of type double, you wil determine which clans battle and wha wil win. Tha clan with the highest value in the given feld will win in a warrior battle aganst he clan with the lowest value in the given feid. Any intermediary clans will not be affected by the battle. Make the folowing updates to the stracture array based on this battle of the field from the given field name (sepond input) which are 1. The winning clan's structure's value in the field given by the secand input should be doubled. 2. The winning clan's structure's value af the Territories fioid, represented by a coil array of strings, should be updated to include the values of the Territories feld in the losing clan's structure. 3. The losing clan's value in the feld given by the second input should be set to zero. 4. The losing clan's value for the Territories fiald should become an empty cell array e values in the teld given by Sort the entire array in descending order based second input Do this using the descend input to sort. In addition to updating the structure array, the function shoud also output a descriptve following format the warrior code, fear leaderStep 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