Question
A sensor that monitors the temperature of a backyard hot tub records the data shown in table bellow:-
Time of the day
Temperature,
Time of the day
Temperature,
Explanation / Answer
a=[100,101,102,103,103,104,104,105,106,106,106,105,104,103,101,100,99,100,102,104,106,107,105,104,104]; l=length(a); %index numbers of the temperatures that exceed the maximum allowable %temperature. indices_exceeding_max_allowable_temp=find(a>105) %times the maximum allowable temperature was exceeded. no_of_times=length(indices_exceeding_max_allowable_temp) %times the temperature exceeded the maximum allowable temperature for(i=1:no_of_times) hours_exceeding_max_allowable_temp=indices_exceeding_max_allowable_temp(i) end %times the temperature was less than the minimum allowable temperature. c=find(a