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
un contenedor de 0.01m∧3 se llena con 2kg de nitrogeno a una presion de 15mpa ¿cual es la temperatura del nitrogeno?resolver uti
777dan777 [17]
Ecfñnokg pinogdf gabn Etta r
7 0
3 years ago
What's the highest grade level that brainly accomodates
taurus [48]

Answer:

The highest grade level is college.

3 0
2 years ago
**Please Help. ASAP**
natima [27]

Answer:

The answer is below

Explanation:

1)

\frac{v-u}{a} =t\\\\Making \ v\ the \ subject\ of\ formula:\\\\First \ cross-multiply:\\\\v-u=at\\\\add\ u\ to \ both\ sides:\\\\v-u+u=at+u\\\\v=u+at

2)

\frac{y-x^2}{x}=3z\\ \\Making\ y\ the\ subject\ of\ formula:\\\\First \ cross \ multiply:\\\\y-x^2=3xz\\\\y=3xz+x^2\\\\y=x(x+3z)

3)

x+xy=y\\\\Making\ x\ the\ subject\ of\ formula:\\\\x(1+y)=y\\\\Divide\ through\ by\ 1+y\\\\\frac{x(1+y)}{1+y} =\frac{y}{1+y} \\\\x=\frac{y}{1+y}

4)

x+y=xy\\\\Making\ x\ the\ subject\ of\ formula:\\\\Subtract\ x\ from \ both\ sides:\\\\x+y-x=xy-x\\\\y=xy-x\\\\y=x(y-1)\\\\Divide\ through\ by \ y-1\\\\\frac{y}{y-1} =\frac{x(y-1)}{y-1}\\ \\x=\frac{y}{y-1}

5)

x=y+xy\\\\Making\ x\ the\ subject\ of\ formula:\\\\Subtract\ xy\ from \ both\ sides:\\\\x-xy=y+xy-xy\\\\x-xy=y\\\\x(1-y)=y\\\\Divide\ through\ by \ 1-y\\\\\frac{x(1-y)}{1-y} =\frac{y}{1-y}\\ \\x=\frac{y}{1-y}

6)

E=\frac{1}{2}mv^2-\frac{1}{2}mu^2\\  \\Making\ u\ the\ subject \ of\ formula:\\\\Multiply \ through\ by \ 2\\\\2E=mv^2-mu^2\\\\mu^2=mv^2-2E\\\\Divide\ through\ by\ m:\\\\u^2=\frac{mv^2-2E}{m}\\ \\Take\ square\ root\ of \ both\ sides:\\\\u=\sqrt{\frac{mv^2-2E}{m}}

7)

\frac{x^2}{a^2}-\frac{y^2}{b^2}=1\\  \\Making\ y\ the\ subject \ of\ formula:\\\\\frac{x^2}{a^2}-1=\frac{y^2}{b^2}\\\\Multiply\ through\ by\ b^2\\\\b^2(\frac{x^2}{a^2} -1)=y^2\\\\Take\ square\ root\ of\ both\ sides:\\\\y=\sqrt{b^2(\frac{x^2}{a^2} -1)}

8)

ay^2=x^3\\\\Make\ y\ the\ subject\ of\ formula:\\\\Divide\ through\ by\ a:\\\\y^2=\frac{x^3}{a}\\ \\Take\ square\ root\ of\ both\ sides:\\\\y=\sqrt{\frac{x^3}{a}} \\

4 0
3 years ago
Find the mechanical average of a wheel axle System of the wheel has a radius of 1.5 feet in the accident has a radius of 6 inche
kvasek [131]

Answer:

Mechanical average of a wheel = 3

Explanation:

Given:

Radius of wheel = 1.5 ft = 1.5 x 12 = 18 inches

Radius of axle = 6 inches

Find:

Mechanical average of a wheel

Computation:

Mechanical average of a wheel = Radius of wheel / Radius of axle

Mechanical average of a wheel = 18 / 6

Mechanical average of a wheel = 3

4 0
3 years ago
Which of the following is the last step in creating a budget?
Greeley [361]

Answer:

<em>D. Determine saving or debt</em>

Explanation:

7 0
3 years ago
Other questions:
  • A fluid flows steadily through a pipe with a uniform cross sectional area. The density of the fluid decreases to half its initia
    6·1 answer
  • Find the sum and product of each of these pairs of numbers. Express your answers as a base 3 expansion. Hint: We can just add an
    5·1 answer
  • The assembly consists of two blocks A and B, which have a mass of 20 kg and 30 kg, respectively. Determine the distance B must d
    14·2 answers
  • A 300-ft long section of a steam pipe with an outside diameter of 4 in passes through an open space at 50oF. The average tempera
    12·1 answer
  • Which of the following is NOT a true statement about construction drawings?
    5·1 answer
  • Although many countries have issues with soil erosion due to deforestation, some of the most serious effects are seen
    8·1 answer
  • An aluminum bar 125 mm long with a square cross section 16 mm on an edge is pulled in tension with a load of 66,700 N and experi
    14·1 answer
  • What is a beam on a bridge? what does it do?
    6·1 answer
  • You need to lower your lift onto the mechanical load-holding devices to provide structural support before working under the lift
    12·1 answer
  • Ferroconcrete is reinforced concrete that combines concrete and ________. A. Lead c. Copper b. Iron d. Aluminum.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!