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
Which element of Miranda's character is best illustrated by this excerpt?
Iteru [2.4K]

Answer:

B. She is compassionate

Explanation:

6 0
3 years ago
Consider a very long, slender rod. One end of the rod is attached to a base surface maintained at Tb, while the surface of the r
9966 [12]

Answer:

(a) Calculate the rod base temperature (°C). = 299.86°C

(b) Determine the rod length (mm) for the case where the ratio of the heat transfer from a finite length fin to the heat transfer from a very long fin under the same conditions is 99 percent.  = 0.4325m

Explanation:

see attached file below

3 0
3 years ago
A slender rod AB, of weight W, is attached to blocks A and B, which move freely in the guides shown. The blocks are connected by
gregori [183]

Answer:

(a) T = W/2(1-tanθ)  (b) 39.81°

Explanation:

(a) The equation for tension (T) can be derived by considering the summation of moment in the clockwise direction. Thus:

Summation of moment in clockwise direction is equivalent to zero. Therefore,

T*l*(sinθ) + W*(l/2)*cosθ - T*l*cosθ = 0

T*l*(cosθ - sinθ) = W*(l/2)*cosθ

T = W*cosθ/2(cosθ - sinθ)

Dividing both the numerator and denominator by cosθ, we have:

T = [W*cosθ/cosθ]/2[(cosθ - sinθ)/cosθ] = W/2(1-tanθ)

(b) If T = 3W, then:

3W = W/2(1-tanθ),

Further simplification and rearrangement lead to:

1 - tanθ = 1/6

tanθ = 1 - (1/6) = 5/6

θ = tan^(-1) 5/6 = 39.81°

8 0
3 years ago
3) Explain how dc machines Can work as motor and generator​
weeeeeb [17]

The working principle of a DC machine is when electric current flows through a coil within a magnetic field, and then the magnetic force generates a torque that rotates the dc motor. The DC machines are classified into two types such as DC generator as well as DC motor.

5 0
1 year ago
Water at 15°C is to be discharged from a reservoir at a rate of 18 L/s using two horizontal cast iron pipes connected in series
Zina [86]

Answer:

0.245 m^3/s

Explanation:

Flow rate through pipe a is 0.4 m3/s Parallel pipes have a diameter D = 30 cm => r = 15 cm = 0.15 m Length of Pipe a = 1000m Length of Pipe b = 2650m Temperature = 15 degrees Va = V / A = (0.4m3/s) / (3.14 (0.15m)^2) = 5.66 m/s h = (f(LV^2)) / D2g (fa(LaVa^2)) / Da2g = (fb(LbVb^2)) / Da2g and Da = Db; fa = fb LaVa^2 = LbVb^2 => La/Lb = Vb^2/Va^2 Vd^2 = Va^2(La/Lb) => Vb = Va(La/Lb)^(1/2) Vb = 5.66 (1000/2650)^(1/2) => 5.66 x 0.6143 = 3.4769 m/s Vb = 3.4769 m/s V = AVb = 3.14(0.15)^2 x 3.4769 m/s = 0.245 m^3/s

5 0
3 years ago
Other questions:
  • After informing his employer that he had cancer, Maury was abruptly fired. The federal legislation that prohibits discrimination
    6·1 answer
  • If link AB of the four-bar linkage has a constant counterclockwise angular velocity of 58 rad/s during an interval which include
    11·1 answer
  • Read a 4 character number. Output the result in in the following format, Input 9873, Output 3 *** 7 ******* 8 ******** 9 *******
    8·1 answer
  • Can someone pls give me the answer to this?
    14·1 answer
  • Cold forging makes metal more workable than hot forging.<br> True<br> False
    11·2 answers
  • A___ remote control can be an advantage to an
    14·2 answers
  • 9. Imagine that you're performing measurements on a circuit with a multimeter. You measure a total circuit
    14·2 answers
  • Analyze the example of this band saw wheel and axle. The diameter of the wheel is 14 inches. The diameter of the axle that drive
    9·1 answer
  • A fully charged new battery will have a low conductance reading.
    12·1 answer
  • Read the passage.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!