Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help, I keep getting errors in my script and I don't know how to fix it. These are the instructions. Please use MATLAB. Download

Please help, I keep getting errors in my script and I don't know how to fix it. These are the instructions. Please use MATLAB.

Download temperatures.zip. Unzip temperatures.zip, which includes text files for 6 different cities. Each of the files has 2 columns and 31 rows. The first column is daily mean temperature in degrees Fahrenheit, and the second column is daily deaths from all causes. Each row corresponds to a day of the month (e.g., row 4 corresponds to July 4, 2007). 2) Create a .m script. Fill in this script in the following steps. 3) Load the data for Chicago using the command load. 4) Create a variable that is equal to the temperature column from the Chicago data. Count the number of very hot (>=91F), hot (>=81F and <91F) and normal temperature (<81F) days that occurred in Chicago in July 2007. Here we will use a combination of for loops and if-elseif-else statements.

Step by step instructions are below.

a. First, create a loop that counts the number of very hot days (>=91F). Hint: As an example of how to do this, look at the lecture slides from this week covering counting algorithms. b. Second, using the same loop, also count the number of hot days (>=81F and <91F). Hint: Use elseif. c. Third, using the same loop, also count the number of normal days (<81F). Hint: Use else. d. Finally, use fprintf to print the results as follows, with the Xs filled in with numbers: In Chicago in July 2007 there were: X very hot days (>91F) XX hot days (81-91F) XX normal days (<81F) 6)Create another .m script that produces the same results as the first script but uses a combination of the functions find and length instead of for loops and if-elseif-else statements.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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