Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Create a 1D array of simulated temperatures (tF) in Fahrenheit for a 1 month period with number of days numDays = 31 according to

1) Create a 1D array of simulated temperatures (tF) in Fahrenheit for a 1 month period with number of days numDays = 31 according to formula:

tF = 75 + 10*sin(nDay*0.4*pi) + 10*rand(1,numDays)

Here nDay is the array of Day numbers (nDay - 1,2,3,...numDays

2) Create a 2nd array (tC) with temperatures converted from Fahrenheit to Celsius according to formula: tC = (tF - 32)*5/9

3) Create a 3rd array (tCSun) with only Sundays temperatures (C) using integer array indexing. Assume that first Sunday falls on nDay = 3

4) Create a 4th array (tCSunHigh) with Sundays temperatures above a threshold tCHigh = 25 C using logical array indexing

5) Print arrays tCSun and tCSunHigh using fprintf function. Temperature values should be printed with one digit after the decimal point. Display value units (C in this case)

Compare the maximum Saturday temperature with the maximum temperature that occurred that month and use an if/else construct to print out the string. 'The highest temperature, [ ouput value] C, occured on a Saturday'

% or % 'The highest temperature, [ouput value] C, did not occur on a Saturday'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

base 6 4 . c

Answered: 1 week ago

Question

Explain the strength of acid and alkali solutions with examples

Answered: 1 week ago

Question

Introduce and define metals and nonmetals and explain with examples

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago