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
Pls help and solve this problem. I don't have an idea to solve this.
lions [1.4K]

Answer:

MIS HIEVOSTES bbbbbbbbbbbb MIS HUEVOTES

7 0
3 years ago
An insulated piston-cylinder device initially contains 0.16 m2 of CO2 at 150 kPa and 41 °C. Electric resistance heater supplied
lyudmila [28]

Answer:

I=0.3636

Explanation:

See the attached picture for explanation.

4 0
3 years ago
Write the implementation (.cpp file) of the Player class from the previous exercise. Again, the class contains:
hoa [83]

Answer:

//Define the header file

#ifndef PLAYER_H

#define PLAYER_H

//header file.

#include <string>

//Use the standard namespace.

using namespace std;

//Define the class Player.

class Player

{

//Declare the required data members.

string name;

int score;

public:

//Declare the required

//member functions.

void setName(string par_name);

void setScore(int par_score);

string getName();

int getScore();    

}

//End the definition

//of the header file.

#endif

Player.cpp:

//Include the "Player.h" header file,

#include "Player.h"

//Define the setName() function.

void Player::setName(string par_name)

{

name = par_name;

}

//Define the setScore() function.

void Player::setScore(int par_score)

{

score = par_score;

}

//Define the getName() function.

string Player::getName()

{

return name;

}

//Define the getScore() function.

int Player::getScore()

{

return score;

}

7 0
3 years ago
21. Explique claramente como el fenotipo es el que favorece o desfavorece los resultados productivos obtenidos tanto en las expl
Montano1993 [528]
Los sistemas de producción pecuaria, son considerados como la estrategia social, económica y cultural más apropiada para mantener el bienestar de las comunidades, debido a que es la única actividad que puede simultáneamente proveer seguridad en el sustento diario, conservar ecosistemas, promover la conservación de la
6 0
3 years ago
technician a says that dynamic voltage is the voltage (usually of a battery) that exists without a load being applied. technicia
Artist 52 [7]

The battery electrolyte's specific gravity can be used to test the status of charge of a battery cell in the most precise and direct manner possible.

The state of charge increases with the specific gravity of the electrolyte. Voltage is the difference in electric potential between a battery's two terminals. The unit of measurement for voltage is called a volt (V), after the battery's creator, John Volta. An electronic tool called a state-of-charge battery tester is made to check the life and rechargability of an electric battery. A battery's current charging status and voltage output can be provided by a state-of-charge tester, which can also look for any defects that might impair the battery's overall performance.

Learn more about battery here-

brainly.com/question/17377812

#SPJ4

8 0
1 year ago
Other questions:
  • Before cutting coarse screw threads, the operator should lubricate: A. The leadscrew and gearbox B. The ways and cross slide C.
    14·1 answer
  • A well pumps at 400 L/s from a confined aquifer whose thickness is 24 m. If the drawdown 50 m from the well is 1 m and the drawd
    10·1 answer
  • Assignment 1: Structural Design of Rectangular Reinforced Concrete Beams for Bending
    6·1 answer
  • What is electromagnetic induction?
    14·1 answer
  • How many volts of electricity would it take to power up an entire city? Take Tokyo for example. Please explain!
    12·1 answer
  • How to code the round maze in CoderZ?
    5·1 answer
  • If most wildfires are suppressed (all fires are put out) for many years, how does the risk of wildfire in the area change in the
    10·1 answer
  • I will definitely rate 5 stars/brainliest!!! HELP PLEASE!!! State University must purchase 1,100 computers from three vendors. V
    13·1 answer
  • What is the best countermeasure against social engineering?
    11·1 answer
  • ____ grinders are used to grind diameters, shoulders, and faces much like the lathe is used for turning, facing, and boring oper
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!