So the brute force implementation would be to run a search through your data and check the lat and lon values. If they are equal, then copy the temp values in a separate array. Once you have gone through the completre data, you can use mean() to find the average. This is a lenghty process though and might take some time to complete.
An easier way to do this would be to use find() to get the indices of all the values of maxlat which are same, then check if those rows are equal.
k = find(maxlat == maxlat(1));
isequal (table(k(1), :), table(k(2), :))
if the answer is true, then average, otherwise skip.