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
By law, who is responsible for providing Safety Data Sheets?
nalin [4]

Answer:

OSHA Hazard Communication Standard is responsible.

Explanation:

5 0
3 years ago
Read 2 more answers
Consider a 6-bit cyclic redundancy check (CRC) generator, G = 100101, and suppose that D = 1000100100. 1. What is the value of R
dmitriy555 [2]

Answer:

The value of R is 10101

Explanation:

As per the given data

D = 1000100100

G = 100101

Redundant bit = 6-bits - 1-bit = 5-bits

No add fice zero to D

D = 100010010000000

Now calculate R as follow

R = D / G

R = 100010010000000 / 100101

R = 10101

Workings are attached with this question

3 0
3 years ago
Will a simple circuit work without a switch? Explain why or why not.
Marina CMI [18]

yes, a simple circuit will work without a switch. If we don't have a switch in a circuit then whichever device you are using electricity for wouldn't be able to switch off and will be working continuously. An open/close switch is usually all that is needed to supply or disconnect power from the source to the circuit.So, the circuit will work but it will work continuously.

7 0
2 years ago
As car production became more efficient, cars became more affordable for american families. One result of this increase in autom
tankabanditka [31]

Answer:

IT IS SIMPLE LIKE HENRY FORD MADE THIS OPTION POSSIBLE

Explanation:

5 0
2 years ago
What is JIT and why would you advocate it to reduce inventory?
bazaltina [42]

Explanation:

Just in time inventory is a system of managing inventory. It is a method to reduce waste, lower cost and increase profit. According to it the raw material orders are directly aligned with the production schedules. In simple words every component of a unit is arriving just in time to be used.

So JIT would be advocated to reduce inventory.

7 0
2 years ago
Other questions:
  • In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab
    14·1 answer
  • For the following conditions determine whether a CMFR or a PFR is more efficient in removing a reactive compound from the waste
    9·1 answer
  • How is the fuel introduced into the Diesel engine?
    9·1 answer
  • Technician A says that proper footwear may include both leather and steel-toed shoes. Technician B says that leather-soled shoes
    8·1 answer
  • A standard penetration test has been conducted on a coarse sand at a depth of 16 ft below the ground surface. The blow counts ob
    7·1 answer
  • The article provides information by using a list. What does it list? A. Thanksgiving food B. places where clams can be found C.
    11·1 answer
  • Define the word vision statement​
    5·1 answer
  • A pumping test was made in pervious gravels and sands extending to a depth of 50 ft. ,where a bed of clay was encountered. The n
    7·1 answer
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
  • What is the creative process that helps you overcome writer's block called?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!