Question Details

[answered] Lab 12 Lab 12: CVG Airport Weather Data Due Friday, Decembe


Hi!?

I was wondering if you could help me with part C number 2 on this lab??

Thanks!?


Lab 12 Lab 12: CVG Airport Weather Data

 

Due Friday, December 2, 2016 at 5:00pm

 

You will be working with a dataset of daily weather statistics taken over the last sixty seven

 

years at the CVG (Cincinnati/Northern Kentucky) Airport. The source of the weather data is the

 

National Oceanic and Atmospheric Administration:

 

http://www.ncdc.noaa.gov/cdo-web/search

 

Part A: Introduction to the CVG Weather Dataset

 

1. Go to the metacourse site on Blackboard under Lab 12, download the Weather.mat file, and

 

save it in your current MATLAB folder.

 

2. At the MATLAB command prompt, type the following:

 

>> load Weather

 

You should now see a dataset called W (24411x9) in your workspace window. If not,

 

make sure Weather.mat really is in your current MATLAB folder and/or ask for assistance.

 

3. Double click on the W dataset array to open it up in the Variable Editor Window. This

 

dataset has eight columns defined as follows: W.Year is the year

 

W. Month is the month

 

W.Day is the day

 

W.Prcp is the daily precipitation (in inches)

 

W.Snwd is the daily snow depth (in inches)

 

W.Snow is the daily snow fall (in inches)

 

W.Tmax is the high temperature for the day (in oF)

 

W.Tmin is the low temperature for the day (in oF)

 

W.Wind is the average wind speed (mph) This dataset begins on January 1st, 1950 and ends on October 31, 2016.

 

4. Note: There are some invalid entries (-9999) scattered throughout this database in the wind,

 

snow, and snow depth columns. A value of 9999 indicates an invalid reading. Invalid

 

readings typically occur in large databases like this. An invalid reading indicates that a

 

measurement wasn?t entered in for that date possibly because somebody forgot to enter it in,

 

or a sensor wasn?t working that day, or the communication between the sensor and the

 

database broke down. In the case of wind speed, the CVG airport didn?t start recording wind

 

speeds until Jan 1, 1984. 1 Lab 12 Part B: Simple Data Analysis on CVG Weather Dataset Array

 

In this part of the lab, you will be answering a series of questions about the W dataset. Include

 

both your answers to the questions and the MATLAB commands used to answer the questions.

 

Make sure you include units in all of your answers.

 

1. Enter your Birthday: __11/19/1997______

 

Use the find command to find the row in the dataset corresponding to your birthday as follows:

 

>> BD_Row = find(W.Year == YourYear & W.Month == YourMonth &

 

W.Day == YourDay)

 

Now display the weather stats on your birthday as follows:

 

>> W(BD_Row,:)

 

PASTE RESULTS HERE:

 

enter your birthday month:11

 

enter your birthday day:19

 

enter your birthday year:1997

 

ans =

 

Year Month

 

1997 11 Day

 

19 Prcp

 

0 Snwd Snow Tmax

 

0

 

0

 

55 Tmin Wind

 

29

 

6

 

2. What was the highest snowfall recorded in a single day at CVG in the dataset?

 

Highest Snowfall in a Single Day:

 

MATLAB Command(s):

 

max(W.Snow)

 

ans =

 

11.8000

 

3. On what date(s) did this maximum snowfall occur?

 

2 Lab 12 Date(s) with Highest Snowfall:

 

2/4/1998

 

MATLAB Command(s):

 

ms=max(W.Snow);

 

ms_row=find(W.Snow == ms)

 

ms_row =

 

17567

 

>> W.Year(17567)

 

ans =

 

1998

 

W.Month(17567)

 

ans =

 

2

 

W.Day(17567)

 

ans =

 

4

 

4. How many days did it rain in April 2011?

 

Number of Rainy Days in April 2011:

 

l_r =

 

12

 

MATLAB Command(s): rainy=find(W.Prcp>0 & W.Month==2 & W.Year==2011)

 

l_r=length(rainy) 3 Lab 12 5. How many invalid entries (-9999) are there for daily snowfall in the dataset?

 

Number of Invalid Entries for Daily Snowfall:

 

25

 

MATLAB Command(s): invalid_snow=find(W.Snow==-9999)

 

length(invalid_snow)

 

6. Fill in the following table. Paste your MATLAB commands for January 1978 below the table

 

where indicated. Month

 

Januar

 

y

 

Januar

 

y

 

Januar

 

y Year Average High

 

Temperature

 

(oF) Standard Deviation

 

of High

 

Temperature (oF) Number of Days

 

with a High

 

Temperature

 

above 60oF 1 1978 26.3548 10.9956 0 1 1993 51.8065 13.3227 11 1 2016 39.3871 12.0158 2 Month

 

Number MATLAB Commands (JUST FOR January 1978): jan1=(W.Month==1 & W.Year==1978)

 

t1=mean(W.Tmax(jan1))

 

stan_dev=std(W.Tmax(jan1))

 

num_days=find(W.Tmax>60 & W.Month==1 & W.Year==1978)

 

lnum_days=length(num_days)

 

Part C: Generating and Plotting Data from the CVG Weather Dataset Array

 

You should write a script file for each of these problems.

 

1. For each year from 1950 through 2016, determine the average daily rainfall in April. Save the results in a vector. (Hint: use for loop to go through each year). After the loop, plot the results with year on the x-axis and mean rainfall on the y-axis.

 

Be sure to add a title and labels to your plot. Also after the loop, add an fprintf statement that outputs the highest average rainfall

 

(two places behind decimal) in April and the year (integer) in which this occurred.

 

4 Lab 12 Output from fprintf statements:

 

1. Maximum average rainfall in April was 0.45 inches in 2011

 

Plot: Code: % Part 1

 

clear;close all;home;commandwindow;

 

load W

 

y=1;

 

for year=1950:2016

 

april=find(W.Year==year & W.Month==4);

 

april_rainfall(y)=mean(W.Prcp(april));

 

y=y+1;

 

end

 

figure(1)

 

clf

 

plot(1950:2016,april_rainfall,'k*--')

 

xlabel('Year');ylabel('Average April

 

rainfall(inches)');title('Average Rainfall')

 

5 Lab 12 xlim([1950 2015])

 

[m,l]=max(april_rainfall);

 

fprintf('\n1. Maximum average rainfall in April was %.2f

 

inches in %g\n',m,l+1950-1)

 

2. For each year from 1950 through 2015 (don?t include 2016 because it may still snow this

 

year), determine the total amount of snow fall for the year. Remember, W.Snow has some

 

invalid entries (-9999) so in your find statement where you search for year add a 2nd

 

condition that the entry in W.Snow is actually valid. Save the results in a vector.

 

After the loop, plot the results with year on the x-axis and total snow fall on the yaxis. Add title and labels to your plot.

 

Also after the loop, add an fprintf statement that outputs the highest snowfall in a

 

single year and the year in which it occurred.

 

Add another fprintf statement that outputs the lowest snowfall in a single year and the

 

year in which is occurred.

 

Add a 3rd fprintf statement that outputs the average yearly snowfall at CVG over the

 

66 year period. Output from fprintf statements:

 

Plot:

 

Code:

 

3. For each year, 1950 to 2015, calculate the total monthly snowfall. This will require a nested

 

loop (one for year and one for month). Save the results in a matrix with the months as rows and the years as columns (your

 

matrix will have 12 rows and 66 columns). After the nested loop, add an fprintf statement to output the maximum snowfall in a

 

single month Also after the nested loop, add a find statement ( [row col ] = find( ) ) to find the row

 

and column in the matrix with the maximum value. Finally, add an fprintf statement to show the month and year in which the maximum

 

amount of snowfall occurred.

 

Output from fprintf statements:

 

Code: 6

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 18, 2020

PRICE: $15

Solution~0001013010.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 18, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now