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 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
You know the right answer?
Function Name: celery Inputs: 1. (cell) MxN cell array of nutrition facts for different foods Output...
Questions
question
Mathematics, 23.06.2019 01:10
question
Mathematics, 23.06.2019 01:10
question
Mathematics, 23.06.2019 01:10
question
Mathematics, 23.06.2019 01:10
Questions on the website: 13722360