8.1 A sensor that monitors the temperature of a backyard hot tub records the dat
ID: 3812674 • Letter: 8
Question
8.1 A sensor that monitors the temperature of a backyard hot tub records the data shown in Table 8.5. Table 8.5 Hot-Tub Temperature Data Time of Day Temperature, "F 100 00:00 01:00 10 102 02:00 03:00 103 04:00 103 05:00 10 06:00 10 07:00 105 106 08:00 106 09:00 106 0:00 11:00 105 12:00 10 13:00 103 14:00 101 15:00 100 16:00 100 17:00 102 18:00 19:00 10 106 20:00 21:00 107 105 22:00 23:00 10 24:00 10 (a) The temperature should never exceed 105 F. Use the find function to find the index numbers of the temperatures that exceed the maximum allowable temperature.Explanation / Answer
Let T be a cell array time and temp be the variable containing the time and temperatures resp then
a) To get indexes of temperatures that exceeds max use i= find(temp > 105)
here i will contain all indexes where temp is greater than 105
b) len = length(i)) len will contain length of result obtained in a
c) To show time at which temp exceeds max temp use T(i)
d. length(find(temp <102))
e. T{find(temp <102)}
f. T{find(temp >102 & temp < 105)}
g. To find max temperature and its index use [max, ind]= max(temp)
To display time of max temp use T(ind) and to display max temp use max
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.