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 18 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd 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_forwardHartley 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_forwardPlease do only C part with breif explanation. I want typed solution. Not hand writtenarrow_forward
- Newton'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_forwardThe first photo is the question, where the 2nd shows some problem solving strategiesarrow_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_forward
- Instrumentation & Measurements This homework measures your capability to design/analyze various components/variables of ameasurement system based on what you have studied. Question is Attached in image. Thank you.arrow_forwardQ \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_forwardHello I’m trying to make the graph that you see in the picture, I’m trying the exact copy of that graph using this code but I’m having a hard time doing that. Could you change the code so that it looks like the graph that you see on the picture using MATLAB, please send the code when you are finished. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Fix the random seed for reproducibility rng(45); % Assumed positions of cars CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves pDiesel = polyfit(carPosition, CO2Diesel, 3); pPetrol = polyfit(carPosition, CO2Petrol, 3); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Plotting the data figure; hold on; scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1 0.5…arrow_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