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]
4 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]4 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
Which state did NOT have people that got sick from the
12345 [234]
New jersey has the least amount out of all of these.
california : 98
new jersey : 17
tennessee : 64
florida : 49
3 0
3 years ago
Everfi futuresmart module 6 retirement pie chart
Katarina [22]

Answer:

good luck

Explanation:

3 0
3 years ago
Read 2 more answers
To provide some perspective on the dimensions of atomic defects, consider a metal specimen that has a dislocation density of 105
GenaCL600 [577]

Answer:

62.14\ \text{miles}

6213727.37\ \text{miles}

Explanation:

The distance of the chain would be the product of the dislocation density and the volume of the metal.

Dislocation density = 10^5\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^5\times 1000=10^8\ \text{mm}\\ =10^5\ \text{m}

1\ \text{mile}=1609.34\ \text{m}

\dfrac{10^5}{1609.34}=62.14\ \text{miles}

The chain would extend 62.14\ \text{miles}

Dislocation density = 10^{10}\ \text{mm}^{-2}

Volume of the metal = 1000\ \text{mm}^3

10^{10}\times 1000=10^{13}\ \text{mm}\\ =10^{10}\ \text{m}

\dfrac{10^{10}}{1609.34}=6213727.37\ \text{miles}

The chain would extend 6213727.37\ \text{miles}

3 0
3 years ago
Six forces act on a beam that forms part of a building's
IrinaVladis [17]

Answer:

<h2> FA = 13 kN </h2><h2>FG = 15.3 kN</h2>

Explanation:

write each force in terms of magnitude and directions  

Fx = F sin Ф

Fy = F cos Ф

where Ф is to be measured from x axis.

∑F at y = o

FAy + FBy + FCy + FDy + FEy + FGy = 0

∑F at x = o

FAx + FBx + FCx + FDx + FEx + FGx = 0

Let  

FA = FA sin (110)   +   FA cos (110)

FB = 20 sin (270)  +  20 cos (270)

FC = 16 sin (140)    +  16 cos (140)

FD = 9 sin (40)       +  9 cos (40)

FE = 20 sin (270)    +  20 cos (270)

FG = FG sin (50)     +  FG cos (50)

add x and y forces:

FAx + FBx + FCx + FDx + FEx + FGx = 0

FAy + FBy + FCy + FDy + FEy + FGy = 0

FA sin (110)  + 0  + 16 sin (140)  + 9 sin (40)  + 0   + FG sin (50) = 0

FA cos (110) - 20 + 16 cos (140) + 9 cos (40) - 20 + FG cos (50 = 0

FA sin (110)  + 0  + 10.285  + 5.785  + 0   + FG sin (50) = 0

FA cos (110) - 20 - 12.257 + 6.894 - 20 + FG cos (50) = 0

FA sin (110)  + 16.070 + FG sin (50) = 0        

FA cos (110) - 45.363 + FG cos (50) = 0

solving for FA, and FG

FA = 13 kN

FG = 15.3 kN

7 0
3 years ago
Find the resistance of a circuit that draws 4 amperes with 8 volts applied?
vodka [1.7K]

Answer:

2 ohms

Explanation:

V = I * R

8 = 4 * R

8 / 4 = R

R = 2 ohms

5 0
3 years ago
Other questions:
  • Suppose a possibly biased die is rolled 30 times and that the face containing
    13·1 answer
  • Zona intermedia de pozos <br> Y<br> Efecto de inavasion
    6·1 answer
  • A horizontal 2-m-diameter conduit is half filled with a liquid (SG=1.6 ) and is capped at both ends with plane vertical surfaces
    11·1 answer
  • A long homogeneous resistance wire of radius ro = 5 mm is being used to heat the air in a room by the passage of electric curren
    15·1 answer
  • Consider laminar, fully developed flow in a channel of constant surface temperature Ts. For a given mass flow rate and channel l
    15·1 answer
  • 5b. The object George is examining has a mass of 15 grams. What is<br> the density of the object?
    5·1 answer
  • Can you carry 1 m3 of liquid water? Why or why not? (provide the weight to support your answer)
    7·1 answer
  • 6. What symptom will be exhibited on an engine equipped with a pneumatic governor system if the cooling fins
    14·1 answer
  • What is the output of the following program fragment. Choose appropriate data-types of variables to match output.
    10·1 answer
  • HELP _7. All of the following except which would lead to an INCREASE in friction?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!