You are an engineer working for M & M / Mars Corporation in the M&M plant. For Halloween, M&Ms are produced in “fun size.” To help with quality control, you create the following worksheet. The factory workers will examine sample bags of M&Ms and enter the weight of the bag and the individual count of M&Ms contained in the bag.
Online, you have been given the following data in a Microsoft Excel workbook called CandyCount.xlsx with the data stored on a sheet named “M and M data.” Only a portion of the actual data is shown.
Write a MATLAB program to read in the Excel data, calculate the data required as shown in the following output table, and write the results to a new Microsoft Excel file. Your output should appear as follows, where the highlighted portion is replaced by the values you calculate in your solution. Your program should also use formatted fprintf statements to display the same table in the Command Window, filling in the missing information (highlighted) and displaying the data using a reasonable number of decimal places.
The program should assume the user could enter more data to the original worksheet or modify the color names on the worksheet and the program would still run correctly.
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- Row indexing: Snow fall records stateSnowRecord contains the amount of snow fall (in cm) for various cities. Rows represent a city and columns represent the snow fall for a given month. Assign citySnow Record with all elements of row rowNum. Ex: If stateSnowRecord is [17.3, 20.3; 4.8, 6.2] and rowNum is 2, then citySnowRecord is [4.8, 6.2]. Function > 6 % 7 % 8 9 10 11 12 13 end function citySnowRecord = Get CitySnowFall (stateSnowRecord, rowNum) 2% Get CitySnow Fall: Returns all snow fall values for city in row rowNum % 4 % Inputs: stateSnowRecord matrix of snow fall records for cities for various months rowNum specified row of stateSnowRecord to return stateSnowRecord = [17.3, 20.3; 4.8, 6.2] Outputs: citySnowRecord - all snow fall values for a given city % Assign citySnowRecord with all elements of a row rowNum. citySnowRecord = stateSnowRecord (rowNum, :); Code to call your function > 1 GetCitySnow Fall([17.3, 20.3; 4.8, 6.2], 2) Previous Assessment: 1 of 2 Tests Passed (50%) Save…arrow_forwardRead the summary below and answer the questions that follow: The Orange Girl – all the juice and nutrition you can ask for Growing up on a citrus farm in Mpumalanga, Yoliswa always wanted to escape to the city. In her little mind, she saw the farm life as the hardest endurance test any individual can be subjected to. She qualified with a mechanical engineering degree and started working in food manufacturing facilities in the city of Jo’burg. The conventional rat race in the city wore Yoliswa down a lot, she started escaping to the farm whenever she got a chance. One day, five years ago, on one of these visits, she found herself wandering on the farm, carried away in childhood memories of how she used to eat oranges directly from trees when they were in season. The farm owner had allowed Yoliswa’s parents to use a section of the farm to grow their own oranges for themselves. Her father decided to follow indigenous ways of growing oranges – his oranges always tasted sweeter, juicier…arrow_forwardNewton's Law of cooling states that the rate at which heat is lost by a heated body is proportional to the difference in temperature between the body and the surrounding medium. Match the following statements/phrases with the corresponding item in the drop down box. Choices in the box 1. In accordance with the stated law obove, we have the equation? 2. If a thermometer is taken outdoors where the temperoture is 5 deg C, from a room in which the temperature is 20 deg C and the reading drops 10 deg C in one minute, the working equation is? 3. In the obove problem, separoting the variables and integrating will result to? 4. In the obove problem, how long, in minutes, after its removal from the room will the reading be 6 deg C? 5. In the obove problem, ofter 30 seconds, whot will be the thermometer reading? 5.2 dT(body temp)/dt = k(Temp of medium - 5) dr(body temp)/dt = k(Temp of body - Temp of medium) Temp of body = Cenkt +5 2.5 13.7 dr(body temp)/dt = k(Temp of medium - Temp of body)…arrow_forward
- Hartley Electronics, Inc., in Nashville, producesshort runs of custom airwave scanners for the defense industry.The owner, Janet Hartley, has asked you to reduce inventory byintroducing a kanban system. After several hours of analysis, youdevelop the following data for scanner connectors used in onework cell. How many kanbans do you need for this connector?Daily demand 1,000 connectorsLead time 2 daysSafety stock 12 dayKanban size 500 connectorsarrow_forwardProblem 3: Insulation To=1 Toowwww Steam Tx2 T₂ T3 www www R₁ R₁ R₂ www.T R₂ Steam at T1 = 320 °C flows in a cast iron pipe (k= 80 W/m. °C) whose inner and outer diameters are 5 cm = 0.05 m and D₂ = 5.5 cm = 0.055 m, respectively. The pipe is covered with 3-cm-thick glass wool insulation with k = 0.05 W/m. °C. Heat is lost to surroundings at T2 = 5 °C by natural convection and radiation, with a combined heat transfer coefficient of h₂ = 18 W/m². °C. Taking the heat transfer coefficient inside the pipe to be h₁ = 60 W/m². °C, determine the temperature drops across the pipe and the insulation. The determination is based on a unit length of the pipe (L = 1 m). Assumptions 1. Heat transfer is one-dimensional since there is no indication of any change with time. 2. Heat transfer is one-dimensional since there is thermal symmetry about the centreline and no variation in the axial direction. 3. Thermal conductivities are constant. 4. The thermal contact resistant at the interface is…arrow_forwardA company finds that if they price their product at $ 65, they can sell 690 items of it. For every dollar increase in the price, the number of items sold will decrease by 10. What is the maximum revenue possible in this situation? (Do not use commas when entering the answer) $ What price will guarantee the maximum revenue? $ Submit Question 國山品 12 MacBook Air esc 吕口 F3 F2 F4 F7arrow_forward
- Q \Fill in the blank the correct word or phrase which is showing reason or result. 1) Large numbers of people from all over the world visit Petra, in Jordan, its beauty. A).so B).because of C).as a result D).because 2) One of the greatest achievements of Emperor Qin Shi Huang was the building of the first Great Wall of China to protect China from its enemies. Not all of his achievements were military, however, as he . introduced a common form of writing throughout the country. a.)in addition b.)plus c.)add d.)also 3) In ancient China, more than 700,000 workers and craftsmen took 38 years to complete the huge imperial palace, offices, and halls, all surrounded by a wall. Qin Shi Huang ordered an army to be built so that his palace would be protected. Emperor a.)add b.)also c.)plus d.)in addition 4 ) Historians are often required to learn languages such as latin read ancient manuscripts and inscriptions. a.)thus b.)as a result c.)in order to d.)therefore 5) In 79 CE Pompeii was covered…arrow_forwarddocs.google.com a The acceleration of an object is proportional to * its velocity its mass its position its displacement the net force acting on it When we say that light objects and heavy objects fall at the same rate, what assumption are we making? * They are falling in a vacuum. all of them They are made of the same material. They have the same shape. They have the same size. What does this graph indicate about the motion of an object ? * O O Oarrow_forwardPart 1: Suppose that our company performs DNA analysis for a law enforcement agency. We currently have 1 machine that are essential to performing the analysis. When an analysis is performed, the machine is in use for half of the day. Thus, each machine of this type can perform at most two DNA analyses per day. Based on past experience, the distribution of analyses needing to be performed on any given day are as follows: (Fill in the table) Part2: We are considering purchasing a second machine. For each analysis that the machine is in use, we profit 1400$. What is the YEARLY expected value of this new machine ( ASSUME 365 days per year - no weekends or holidaysarrow_forward
- Hi, I need help with the first part of the problem below because I'm very confused about how P1 and P2 should be calculated. If you look at my notes to solve the problem there is already a formula in place as I always thought the Patm should also be multiplied by the Area in the numerator, but it's not if I look at this specific tutorial solution given by my course but it's not explained why. I have done a while ago a very similar problem with using that formula in my notes and it gave me the right results, but it's not working for this one. Could you please help me understand why as I have a test coming soon? Figure Q3 (see image attached) shows a cylinder and pistonenclosing air, the movement of the pistonbeing restrained by a compression spring ofstiffness 20 kN/m. The air is heated andexpands, the piston moving 0.3 m. Thefree length of the spring is 1.0 m.Calculate the work done by the air duringthe process.If the pressure , volume and internal energyof air are related by the…arrow_forwardSuppose a flu epidemic has broken out in all math 1215 courses at your school. Assume a total of 24 people have the flu as of today and that each day the total number people who have the flu double. Let f(t) represent the number of people who have the flu at t days since today. Estimate numerically when the number of people will reach 768. {your final answer just number}arrow_forwardSimple Machines-Levers, Inclined Planes, and Pulleys Directions: Use the appropriate equation to answer the following questions. All answers should be recorded below or in your Engineering Design journal. Remember to show all work. A lever has an effort arm that is 5 meters long and a resistance (load) arm that is 3.5 meters long. How much effort is needed to lift a 100 Newton weight? 5K i). Draw the figure representing the problem ii). How much effort is needed to lift a 100 Newton weight? iii). What is the Actual Mechanical Advantage 1. 5m i) AOON 5-5marrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY