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)
- Please make the exact graph that you see in the picture, along with the graph are numbers that are data. Please make the exact graph do not make anything thing different, the blue and orange circles should be there and the lines should be the same including the titles. Please make sure everything is exactly the same. Use MATLAB, and send the code and please make sure no error signs comes up. Take your time please I need help.arrow_forwardWhat would be the analysis of the given table or graph?arrow_forwardplease do need answer for d e and f With value of student 4arrow_forward
- 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
- Read 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_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_forwardKeep the same colors the same graph, basically keep everything the same just make the line with a small curve just as shown on the picture Keep everything the same just make the line less curvy please do not change the colors of the line and the circles do not change anything besides the curve of the line. Use this code on MATLAB and fix it. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Use the 'seed' function instead of 'rng' seed = 50; % Define your seed here rand('seed',seed); % Assumed CO2 emissions for Diesel and Petrol 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 with a reduced degree of 2 pDiesel = polyfit(carPosition, CO2Diesel, 2); pPetrol = polyfit(carPosition, CO2Petrol, 2); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition);…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