1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alinara [238K]
3 years ago
10

HW6P2 (20 points) The recorded daily temperature (°F) in New York City and in Denver, Colorado during the month of January 2014

is given by the data file NYCDen Jan 14.dat (data from the U.S. National Oceanic and Atmospheric Administration). The first column is the day of the month 2ad column is NYC temperatures and 3 column is Denver temperature. Write a MATLAB program in a script file HW6P2.m that does the following: a) (1 pt) Imports the data file NYCDen Jan14.dat b) (2 pts) Assigns the columns of NYCDen Jan 14 to variables DAY, T.NYC and T_DEN, respectively c) (3 pts) Determines the average temperature for the month of January 2014 in each city (rounded to the nearest degree). You can use the mean() built-in MATLAB function to calculate the average. Your display must be in the format "The average temperature in sss for Jan. 2014 is XX *P." Where sss refers to the name of the city and xx refers to the temperature value. This text must be displayed for each city d) (3 pts) Determines and displays the number of days where the temperat was above the average of that city. Your display must be in the format "The temperature in Sss was above the average for xx days. This text must be displayed for each city refers to the number of days while sss refers to the city 0) (3 pts) Determines and displays the number of days where the temperature in each city was above the average of NYC but below the average of DEN. Your display must be in the format "The temperature in SSS was above NYC average and below DEN average for Xx days. This text must be displayed for each city. refers to the number of days while sss refers to the city. (3 pts) Determines and displays the number of days where the temperature in each city was above either the average of NYC or the average of DEN. Your display must be in the format "The temperature in SSS was above either NYC average or DEN average for xx days. This text must be displayed for each city, OK refers to the number of days while sss refers to the city. 8) (5 pts) Determines and displays the days that the temperature in Denver was lower than the temperature in New York city and the temperature difference for these days. Your display must be repeated for all days in the format: On Jan. xx 2014, DEN temp. was lower than NYC temp. by Xx . XX refers to the day or the value of the temperature difference. Use fprintf() with 1 format character to display Xox data with a field width of 2. Do Not define a field width for SSS strings. Leave a blank line between every data set (cd. e. f and g) displayed in the command window.

Engineering
1 answer:
Maurinko [17]3 years ago
8 0

Answer & Explanation:

function Temprature

NYC=[33 33 18 29 40 55 19 22 32 37 58 54 51 52 45 41 45 39 36 45 33 18 19 19 28 34 44 21 23 30 39];

DEN=[39 48 61 39 14 37 43 38 46 39 55 46 46 39 54 45 52 52 62 45 62 40 25 57 60 57 20 32 50 48 28];

%AVERAGE CALCULATION AND ROUND TO NEAREST INT

avgNYC=round(mean(NYC));

avgDEN=round(mean(DEN));

fprintf('\nThe average temperature for the month of January in New York city is %g (F)',avgNYC);

fprintf('\nThe average temperature for the month of January in Denvar is %g (F)',avgDEN);

%part B

count=1;

NNYC=0;

NDEN=0;

while count<=length(NYC)

   if NYC(count)>avgNYC

       NNYC=NNYC+1;

   end

   if DEN(count)>avgDEN

        NDEN=NDEN+1;

   end

   count=count+1;

end

fprintf('\nDuring %g days, the temprature in New York city was above the average',NNYC);

fprintf('\nDuring %g days, the temprature in Denvar was above the average',NDEN);

%part C

count=1;

highDen=0;

while count<=length(NYC)

   if NYC(count)>DEN(count)

       highDen=highDen+1;

   end

   count=count+1;

end

fprintf('\nDuring %g days, the temprature in Denver was higher than the temprature in New York city.\n',highDen);

end

%output

check the attachment for additional Information

You might be interested in
What is the net force acting on a car cruising at a constant velocity of 70 km/h (a) on a level road and (b) on an uphill road?
ElenaW [278]

Answer:

a) zero b) zero

Explanation:

Newton's first law tells us that a body remains at rest or in uniform rectilinear motion, if a net force is not applied on it, that is, if there are no applied forces or If the sum of forces acting is zero. In this case there is a body that moves with uniform rectilinear motion which implies that there is no net force.

4 0
3 years ago
For which of the following structures would a pile foundation be appropriate? (Select all that apply.)
tiny-mole [99]

Answer:

Football stadium on rocky soil

Skyscraper on bedrock

Apartment building on sandy soil

Explanation:

6 0
3 years ago
BRO FNAF ANIMATRONICS ALL OF THEM INCLUDING THE BOOKS AND THE OTHER ONES IN FNAF SPECIAL DELIVERY!
Nezavi [6.7K]
Nice nice. . . . . . .
9 0
3 years ago
Read 3 more answers
In Illinois, once a person has obtained their boating education certificate what is the minimum age to operate a motorized vesse
bixtya [17]

Answer:

I dont really know, I am sorry, but I am going to ask my teacher

5 0
3 years ago
Read 2 more answers
A consulting firm submitted a bid for a large research project. The firm's management initially felt there was a 50/50 chance of
klemol [59]

Answer:

1. 0.50

2. 0.75

3. 0.65

Explanation:

1. For the bid being successful with a 50-50 chance, we have the probability:

50/(50 + 50) = 50 / 100 = 0.50

2. Given the request for additional info:

Probability = probability of request and successful / probability of successful

= 75 / 100 = 0.75

3. We will evaluate the probability of being successful given its request

We will use the Bayesian theorem

= [P(request | successful) * P(successful)] / [P(request | successful) * P(successful) + P(request | unsuccessful) * P(unsuccessful)]

= ( 0.75 * 0.5) / (0.75 * 0.5 + 0.4 * 0.5)

= 0.65

6 0
3 years ago
Other questions:
  • Automotive service P2 Wastewater Management and Handling Spins
    9·1 answer
  • What was the purpose of the vasa ship
    11·1 answer
  • The air velocity in the duct of a heating system is to be measured by a Pitot-static probe inserted into the duct parallel to th
    13·1 answer
  • A three-phase transformer bank consists of 3 single-phase transformers to handle 400 kVA witha 34.5kV/13.8kV voltage ratio. Find
    7·1 answer
  • What was the first roblox player A.bob B.roblox C.builderman
    5·2 answers
  • A hypothetical A-B alloy of composition 57 wt% B-43 wt% A at some temperature is found to consist of mass fractions of 0.5 for b
    15·1 answer
  • First real answer i’ll give Brainlyist
    12·1 answer
  • An incremental encoder is rotating at 15 rpm. On the wheel there are 40 holes. How many degrees of rotation would 1 pulse be?
    11·1 answer
  • Why is personal development necessary based activity success life and career​
    11·1 answer
  • which of the following is not a general education elective area? group of answer choices humanities/fine arts social/behavioral
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!