Here's what I put together using random temperatures between 30 and 100 over the period of interest. Since the temperatures are random, about half of the 365 or 366 days each year are lower than the period average.
% test data (random hourly temperatures from 1900 to 2017)
dt1 = datetime('1900-01-01', 'InputFormat','yyyy-MM-dd');
dt2 = datetime('2017-12-31', 'InputFormat','yyyy-MM-dd');
dt = (dt1:hours(1):dt2)';
tmp = randi([30 100], length(dt),1); % random temperatures between 30 and 100
% organize in timetable
TT = timetable(dt, tmp);
% retime to get daily mean temperature
TT1 = retime(TT, 'daily', 'mean');
% average daily temperature for the period 1900 to 2017
epochAverage = mean(TT1.tmp);
% add a column flagging each day where the average temperature < epochAverage
TT1.LowerThanAverage = TT1.tmp < epochAverage;
% retime to get the number of days each year with temperature < epochAverage
TT2 = retime(TT1, 'yearly', 'sum');
epochAverage % average temperature over the period of interest
TT2([1:5 (end-4):end], 2) % results for first 5 years and last 5 years