subject

Function Name: celery Inputs: 1. (cell) MxN cell array of nutrition facts for different foods Outputs: 1. (struct) 1x(M-1) structure array containing those same nutrition facts Banned Functions: cell2struct Topics: (structures), (cell arrays), (iteration), (sorting) Background: Lucky the Leprechaun loves his job. He gets to carry his pot of gold all the way to the end of the rainbow every year on a very special day. Lately however, he has noticed that he seems to be getting tired more easily and seems to struggle to get to the end. Perhaps it is all the chocolate coins and four-leaf clovers that he is eating. With the spring equinox on the horizon (which is basically New Year's for leprechauns), Lucky resolves to get back in shape, and luckily for him, one of his friends gifted him a data structure of nutritional information to celebrate the most important holiday of March, National Celery Month! Unfortunately, all his nutritional info is jumbled up in cell arrays (his friend did not pay attention when they taught structures in 1371), which are no better than runes to Lucky. You decide to help Lucky convert all his cell arrays to structures (in return for some of his gold, of course). Function Description: Given an MxN cell array, convert the cell array into a structure array. The first row of the cell array will contain the field names to use in the structure array. Each row after the first contains information for a single food item. There will always be a 'Rating' column containing the health rating of the foods. The values in the 'Rating' column will lie between 1 and 10 (inclusive, 10 being the healthiest). The structure array should be sorted by health rating, from most healthy to least healthy (numerically descending). Example: cellFoods 'Calories'; = {'Carbs', 'Name', 'Rating', 1 44, 'Four-Leaf Clovers', 4, 444; 9, 'Chocolate Coins', 2, 80; 19, 'Celery', 9, 70}; structFoods = celery (cellFoods); structFoods Carbs: Name : Rating: Calories: 19 'Celery' 44 'Four-Leaf Clovers' 9 'Chocolate Coins' 2 70 444 Notes: The location of the 'Rating' column is not guaranteed. There may be ties for health rating. In these cases, let MATLAB's internal decision making decide the order of ties. There will always be at least one food item. Hints: Recall that a structure's field names have no particular order. The cell2mat() function may be useful.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
How is the number 372 written when expanded out to place values in the base 8 (octal) number system? a. 2 x 4 + 3 x 2 + 4 x 1 b. 3 x 64 + 7 x 8 + 2 x 1 c. 3 x 8 + 7 x 7 + 2 x 6 d. 3 x 100 + 7 x 10 + 2 x 1
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Along what line of action can the camera move to follow the movement of actors for screen direction? a. along a 90-degree arcb. along a 120-degree arcc. along a 180-degree arcd. along a 360-degree arc
Answers: 1
You know the right answer?
Function Name: celery Inputs: 1. (cell) MxN cell array of nutrition facts for different foods Output...
Questions
question
Mathematics, 21.07.2019 22:00
question
History, 21.07.2019 22:00
Questions on the website: 13722360