Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need Help in MatLab.(Need Urgent Help) Please. The Excel file Clemson_Temp.xlsx contains the daily maximum and minimum temperatures for Clemson from 2008-2017 Day -> 2
Need Help in MatLab.(Need Urgent Help) Please.
The Excel file "Clemson_Temp.xlsx" contains the daily maximum and minimum temperatures for Clemson from 2008-2017 Day -> 2 MonthMin/Max 1 MAX MIN 2 MAX MIN 3 MAX MIN 4 MAX MIN 5 MAX MIN 2 49 23 53 27 67 31 75 57 53 32 13 59 29 26 59 35 74 61 63 43 39 57 61 53 71 42 10 81 81 82 52 12 51 Y2008 Y2009 Y2010 Y2011 Y2012 Y2013 Y2014 Each year's data is stored in a seperate sheet, and each pair of rows (MAX/MIN) are for a given month. You are writting 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 MonthMax and MonthMin and should be 12x1 vectors (one monthly minimum and maximum value for every month of the selected year) Each year's data is stored in a seperate sheet, and each pair of rows (MAX/MIN) are for a given month You are writting 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 MonthMax and MonthMin 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? the doc pages for the min and max functions to see how to do this. Additionally, look at the next hint for help indexing everyother row (the opposite is true for the minimum monthly temperature). You can do this with indexing! In addition to indexing a range, like 3:11 . 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 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 which would pull positions 3 through 11, you can include an increment value in the middle, like 3:2:11 which would pull the positions 3 through 11 irn increments of 2 (in other words positions 3, 5, 7, 9, 11) Your Script C Reset MATLAB Documentation 1 Variables to be used 2 % 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 6 % Intermediate 7 % 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 13 %% Inputs -Only edit this section if you are testing this code in MATLAB 14 Generate-Yea r % Comment this out to test in MATLAB. This gene rates 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 1 17 %% PROGRAM 18 % Start writing your program here 19 % Generate the sheet name based on the variable Year (see problem description for hint) 21 % read in Excel file 23 % calculate the monthly maximums (this can be done in one or two lines-see problem description for hints) 24 25 % calculate the monthly minimums (this can be done in one or two lines-see problem description for hints)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started