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
How does the action of wind affect a rock’s appearance?
Svetllana [295]

Answer:

Forces like wind and water break down rocks through the processes of weathering and erosion. ... Forces like wind and water move the rock pieces. They mix with matter like sand to become sediment. Weathering and erosion help shape Earth's surface.

5 0
3 years ago
Read 2 more answers
A 900 kg car is accelerated from a speed of 10 m/s to 30 m/s. An estimated heat loss of 20 BTU's occurs during the acceleration.
Strike441 [17]

Answer:

Work = 651,1011 kJ

Explanation:

Let´s take the car as a system in order to apply the first law of thermodynamics as follows:

E_{in}- E_{out}=E_{system,final}- E_{system,initial}

Where

E_{in}- E_{out}=(Q_{in}-Q_{out})_{heat}+(W_{in}-W_{out})_{work}+(Em_{in}-Em_{out})_{mass}

And considering that there is no mass transfer and that the only energy flows that interact with the system are the heat losses and the work needed to move the car we have:

E_{in}- E_{out}=-Q_{out}+W_{in}

Regarding the energy system we have the following:

E_{system,final}- E_{system,initial}=(U_{f}-U_{i})_{internal}+(1/2m(V^2_{f}-V^2_{i}))_{kinetic}+(mg(h_{f}-h_{i}))_{potential}

By doing the calculations we have:

E_{system,final}- E_{system,initial}=[0,1*900]_{internal}+[0,5*900(30^2-10^2)/1000)_{kinetic}+(900*10*(20-0)/1000)_{potential}\\E_{system,final}- E_{system,initial}=90+360+180=630kJ

Consider that in the previous calculation, the kinetic and potential energy terms were divided by 1.000 to change the units from J to kJ.

Finally, the work needed to move the car under the required conditions is calculated as follows:

W_{in}=Q_{out}+E_{system,final}- E_{system,initial}\\W_{in}=21,1011+630=651,1011kJ

Consider that in the previous calculation, the heat loss was changed previously from BTU to kJ.

4 0
3 years ago
The difference between a thermocouple and a thermistor is the A. technology inside. B. thermocouple measures temperatures at the
Zepler [3.9K]

Answer: B. thermocouple measures temperatures at the tip and the thermistor at the dimple.

Explanation:

A thermistor is a temperature-sensitive resistor, whilst a thermocouple generates a voltage proportional to the temperature. Thermocouples can work at much higher temperatures than thermistors. They are commonly used for temperature control in heating systems.

8 0
3 years ago
Name the variable in this experiment
taurus [48]
You have to show the story or experiment so we know
7 0
3 years ago
A metal shear can be used to cut flat stock , round stock , channel iron and which of the following?
Charra [1.4K]

Answer:

Angle Iron

Explanation:

Mark brainliest please.

3 0
3 years ago
Other questions:
  • The steel shaft has a radius of 15 mm. Determine the torque Tin the shaft if the two strain gages, attached to the surface of th
    13·1 answer
  • The moisture in hot, humid, stagnant air surrounding a cold-water pipeline continually diffuses to the cold surface where it con
    14·1 answer
  • An electric field is expressed in rectangular coordinates by E = 6x2ax + 6y ay +4az V/m.Find:a) VMN if point M and N are specifi
    14·1 answer
  • Find out the birthday (month and day but not year) of a randomly chosen person. What is the sample space of the experiment? How
    11·1 answer
  • If the tank is designed to withstand a pressure of 5 MPaMPa, determine the required minimum wall thickness to the nearest millim
    8·1 answer
  • Use pseudocode. 1) Prompt for and input a saleswoman's sales for the month (in dollars) and her commission rate (percentage). Ou
    6·1 answer
  • ............................................................................<br> cuanto es 2+2
    10·2 answers
  • Who is ACP pradyuman
    13·2 answers
  • What Forces are involved with roller coasters?
    12·2 answers
  • Damage reports should contain the information needed for what?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!