Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write conplete matlab code! The Excel file Clemson_Temp.xlsx contains the daily maximum and minimum temperatures for Clemson from 2008-2017 D E F Day -> 2

write conplete matlab code!
image text in transcribed
image text in transcribed
The Excel file "Clemson_Temp.xlsx" contains the daily maximum and minimum temperatures for Clemson from 2008-2017 D E F Day -> 2 Month Min/Max 1 MAX MIN 2 MAX MIN MIN 4 MAX MIN 5 MAX MIN Y2008 2009 Y2010 Y2011 Y2012 V2013 Y2014 Each year's data is stored in a separate sheet, and each pair of rows (MAX/MIN) are for a given month. You are writing a program that will calculate the monthly maximum and minimum temperatures for a selected year. The program already has let the year be selected and the selected year is currently stored as a scalar in the variable Year. You need to read in the sheet from the Excel file which corresponds to the selected year and store the numeric data in TempData Read in the entire sheet and do not give any cell ranges. From this data calculate the maximum monthly temperatures (the maximum of the MAX rows) and the minimum monthly temperatures (the minimum of the MIN rows) for each month. These values should be stored as Month Max and Month Min and should be 12x1 vectors (one monthly minimum and maximum value for every month of the selected year). Hints: To not hardcode the sheet name, you need to create a string which matches the sheet name using the value in the variable Year. What function do you know that lets you created a formatted string that can include variable values? Finding the min and max monthly temperatures can be done in one line each. You don't need to do it 12 times (once for each month). Take a look at the doc pages for the min and max functions to see how to do this. Additionally, look at the next hint for help indexing. . When you find the maximum monthly temperature, you want to find the maximum of the MAX rows, not the MIN rows, therefore you want to pull out A 532 PM d 2/13/2020 Script e Roset MATLAB Documentation 1 XX Variables to be used % Inputs 3 % Clemson_Temp.xlsx is a spreadsheet as described in the problem statement 4 % Year - scalar which contains the year for which the stats are to be calculated % Intermediate % TempData - matrix containing all the numeric data from the Excel sheet 9 % Outputs 10 % MonthMax - 12x1 vector of the monthly maximums 11 % MonthMin - 12x1 vector of the monthly minimums XX Inputs - Only edit this section if you are testing this code in MATLAB 14 Generate_Year % Comment this out to test in MATLAB. This generates the variable Year 15 % You also have to read in the Excel sheet. You will need to create your own copy of the Excel file to use when you run this code in 17 X PROGRAM % Start writing your program here 19 % Generate the sheet name based on the variable Year (see problem description for hint) X read in Excel file x calculate the monthly maximums (this can be done in one or two lines - see problem description for hints) 25 % calculate the monthly minimums (this can be done in one or two lines - see problem description for hints) 5:33 PM

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

suggest a range of work sample exercises and design them

Answered: 1 week ago