Humidity: 383x1 double
Values:
Min
29
Median
64
Max
97
Events: 383x1 categorical
Values:
Fog
7
Hail
1
Rain
108
Rain-Snow
4
Snow
18
Thunderstorm
12
None
233
Combine the bicycle data with the weather data to a common time vector using synchronize. You
can resample or aggregate timetable data using any of the methods documented on the reference
page for the synchronize function.
Synchronize the data from both timetables to a common time vector, constructed from the
intersection of their individual daily time vectors.
data = synchronize(dayCount,weatherData,'intersection');
head(data)
ans=8×7 timetable
Time
Day
Total
Westbound
Eastbound
TemperatureF
Humidi
___________________
_________
_____
_________
_________
____________
______
2015-07-01 00:00:00
Wednesday
997
544
453
72
78
2015-07-02 00:00:00
Thursday
1943
1033
910
72
60
2015-07-03 00:00:00
Friday
870
454
416
70
56
2015-07-04 00:00:00
Saturday
669
328
341
67
75
2015-07-05 00:00:00
Sunday
702
407
295
72
67
2015-07-06 00:00:00
Monday
1900
1029
871
74
69
2015-07-07 00:00:00
Tuesday
2106
1140
966
75
77
2015-07-08 00:00:00
Wednesday
1855
984
871
79
68
Compare bicycle traffic counts and outdoor temperature on separate y axes to examine the trends.
Remove the weekends from the data for visualization.
idx = ~isweekend(data.Time);
weekdayData = data(idx,{'TemperatureF','Total'});
figure
yyaxis left
plot(weekdayData.Time, weekdayData.Total)
ylabel('Bicycle Count')
yyaxis right
plot(weekdayData.Time,weekdayData.TemperatureF)
ylabel('Temperature (\circ F)')
title('Bicycle Counts and Temperature Over Time')
xlim([min(data.Time) max(data.Time)])
10 Timetables
10-64
Values:
Min
29
Median
64
Max
97
Events: 383x1 categorical
Values:
Fog
7
Hail
1
Rain
108
Rain-Snow
4
Snow
18
Thunderstorm
12
None
233
Combine the bicycle data with the weather data to a common time vector using synchronize. You
can resample or aggregate timetable data using any of the methods documented on the reference
page for the synchronize function.
Synchronize the data from both timetables to a common time vector, constructed from the
intersection of their individual daily time vectors.
data = synchronize(dayCount,weatherData,'intersection');
head(data)
ans=8×7 timetable
Time
Day
Total
Westbound
Eastbound
TemperatureF
Humidi
___________________
_________
_____
_________
_________
____________
______
2015-07-01 00:00:00
Wednesday
997
544
453
72
78
2015-07-02 00:00:00
Thursday
1943
1033
910
72
60
2015-07-03 00:00:00
Friday
870
454
416
70
56
2015-07-04 00:00:00
Saturday
669
328
341
67
75
2015-07-05 00:00:00
Sunday
702
407
295
72
67
2015-07-06 00:00:00
Monday
1900
1029
871
74
69
2015-07-07 00:00:00
Tuesday
2106
1140
966
75
77
2015-07-08 00:00:00
Wednesday
1855
984
871
79
68
Compare bicycle traffic counts and outdoor temperature on separate y axes to examine the trends.
Remove the weekends from the data for visualization.
idx = ~isweekend(data.Time);
weekdayData = data(idx,{'TemperatureF','Total'});
figure
yyaxis left
plot(weekdayData.Time, weekdayData.Total)
ylabel('Bicycle Count')
yyaxis right
plot(weekdayData.Time,weekdayData.TemperatureF)
ylabel('Temperature (\circ F)')
title('Bicycle Counts and Temperature Over Time')
xlim([min(data.Time) max(data.Time)])
10 Timetables
10-64
