Question: MATLAB Function to calculate difference in temperature in different days of the week Problem : Create a function to calculate difference in temperature i.e. difference

MATLAB Function to calculate difference in temperature in different days of the week

Problem : Create a function to calculate difference in temperature i.e. difference in 2 vectors Temperature 1 and Temperature 2. Calculate which of the days of first week was hotter than days in second week.

Task 1. Create 2 input vectors of size 1*7 that will be used to store different temperature values for 2 weeks.

Task 2. Make the function return the difference in temperature values and the hotter days.

Hint: function [ diff, hotter] = differenceInTemperatures( Week1, Week2)

Task 3. Assign hotter = 0 if week 2 is hotter, hotter= 1 if week 1 is hotter, and hotter = 2 if both the days have equal temperature

Please make sure all Tasks are satisfied in the final code!

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!