echo on
%EXERCISE 1: INDEXING
load weather
temp = w_data(:,1)            %Get temp column
maxtemp = max(temp);          %Find maximum temp
[sortedtemp, i] = sort(temp); %Sort Temp
sortedtime = time(i);         %Sort Time (to match temp order)
maxtime = sortedtime(end);    %Find time of Max temp

% Alternative solution to find the time when the maximum temperature occurred.
% temptime=[temp, time];
% sorttemptime=sortrows(temptime);
% The very last line highlights the time of the maximum temperature.
echo off