Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!